threading.currentThread().exit()
时间: 2023-09-03 19:09:06 浏览: 234
进程退出ExitThrd
4星 · 用户满意度95%
threading.currentThread().exit()是一个错误的用法。在Python中,threading.currentThread()返回当前线程对象,而exit()方法并不存在于Thread类中。正确的用法是使用threading.currentThread().join()来等待当前线程结束。该方法会阻塞主线程,直到当前线程执行完毕。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [C#中的线程四(System.Threading.Thread)](https://blog.csdn.net/weixin_30551963/article/details/95013699)[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* *3* [阅读Python官网文档对threading.Thread线程的介绍](https://blog.csdn.net/HayPinF/article/details/119063911)[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 ]
阅读全文