_endthreadex
时间: 2024-04-26 16:26:44 浏览: 177
_endthreadex是一个函数,在C/C++中用于终止线程的执行。它可以显式地调用来终止线程,但通常情况下,当线程从作为参数传递给_beginthreadex的线程函数中返回时,_endthreadex会自动被调用。使用_endthreadex来终止线程有助于确保为线程分配的资源得到正确的恢复。与Win32ExitThreadAPI类似,_endthreadex并不会关闭线程句柄,所以在使用_beginthreadex和_endthreadex时,需要通过调用Win32CloseHandleAPI来关闭线程句柄。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [C语言: 多线程(2)-线程的停止和创建](https://blog.csdn.net/weixin_41049188/article/details/103946554)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [_endthread, _endthreadex的调用_随笔](https://blog.csdn.net/wqwqh/article/details/100543096)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文