当前位置:网站首页>Thread considerations

Thread considerations

2022-06-24 07:47:00 Fog dispels eyesight

Thread considerations
How the thread ends :
1 Thread functions return This is a normal exit
2 ExitThread
This function will terminate the thread , And causes the operating system to clear all operating system resources used by the thread . however ,C++ resources ( Such as C++ Class object ) Will not be revoked . For this reason , It's best to return... From a thread function , Instead of calling ExitThread Come back to .
Of course , have access to ExitThread Of dwExitThread Parameter tells the system why to set the exit code of the thread .ExitThread The function does not return any value , Because the thread has terminated , Can't execute more code .
3 TerminateThread
This kind of situation , Do not release the stack resources of the thread
4 The process exited .

原网站

版权声明
本文为[Fog dispels eyesight]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206240252198476.html