BOOST源码笔记(2) - boost::thread之内部干将interrupt_wait

本文详细探讨了BOOST Thread库中的interrupt_wait功能,分析了其内部机制,包括预定义的中断点、成员函数,以及如何通过事件句柄和抛出thread_interrupted异常来实现线程中断。文章还介绍了interrupt原理,展示了thread_data_base结构,阐述了interruptible_wait函数的工作流程,以及中断点interruption_point和interruption_requested的作用。
摘要由CSDN通过智能技术生成

    BOOST的Thread库博大精深,有很多的多线程概念在里面,今天就对其中很多call都用到的interrupt_wait的实现进行解释。首先,在BOOST文档中,有1个不得不看的概念,如下:

Predefined Interruption Points

The following functions are interruption points, which will throw boost::thread_interrupted if interruption is enabled for the current thread, and interruption is requested for the current thread:

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值