7-线程控制
让线程挂起
DWORD SuspendThread(
HANDLE hThread
// handle to the thread
);让挂起的线程恢复
DWORD ResumeThread(
HANDLE hThread
// identifies thread to restart
);一个线程可以挂起多次,挂起多少次就得恢复多少次。
等待线程执行完毕函数
DWORD WaitForSingleObject(
HANDLE hHandle,
// handle of object to wait for
DWORD dwMilliseconds
// time-out interval in milliseconds
);
用法可参考:https://www.cnblogs.com/rainbow70626/p/10170733.html
获取线程结束后的返回值
BOOL GetExitCodeThread(
HANDLE hThread,
// handle to the thread
LPDWORD lpExitCode
// address to receive termination status
);If the function succeeds, the return value is nonzero.
评论讨论 (0) Artalk 自托管