开发者

ExitThread versus Allowing Thread Function to Exit Normally - C++

开发者 https://www.devze.com 2023-01-26 12:22 出处:网络
My application has a thread that is created using CreateThread.What is the difference between calling ExitThread from within said thread and allowing the thread to exit normally (i.e. reaching the end

My application has a thread that is created using CreateThread. What is the difference between calling ExitThread from within said thread and allowing the thread to exit normally (i.e. reaching the end of the thread function)? I am using C++ and Vis开发者_JS百科ual Studio 2008. Thanks.


Actually, something very important:

..., in C++ code, the thread is exited before any destructors can be called or any other automatic cleanup can be performed. Therefore, in C++ code, you should return from your thread function

(Edit Source)

0

精彩评论

暂无评论...
验证码 换一张
取 消