Sha*_*zad 0 c++ multithreading
可能重复:将
参数传递给_beginthreadex
我怎样才能调用TestFunction2,而不是TestFunction1在ExecuteLocalThread使用beginthreadex作为TestFunction2包含3个额外的参数
unsigned __stdcall TestFunction1(void* timerPointer)
{
unsigned result =0;
printf("thread is running\n");
return result;
}
unsigned __stdcall TestFunction2(void* timerPointer, wchar_t *appId, wchar_t *userName, wchar_t *password)
{
unsigned result =0;
printf("thread is running\n");
return result;
}
void ExecuteLocalThread()
{
HANDLE heartBeatThread;
unsigned int hbThreadID;
heartBeatThread = (HANDLE)_beginthreadex(NULL, 0 , &TestFunction1, (void*)this, CREATE_SUSPENDED, &hbThreadID);
ResumeThread( heartBeatThread );
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
334 次 |
| 最近记录: |