2013年9月10日

【boost】使用装饰者模式改造boost::thread_group

摘要: 在项目中使用boost::thread_group的时候遇到几个问题:1、thread_group不提供删除全部thread列表的方法,一直使用create会是其内部列表不断增加。2、thread_group不提供try_join_for等方法,在线程中等待时,无法调用peekmessage函数来重新激活消息队列。由于thread_group的接口本来就比较小,因此可以直接重写,但是这个时候使用装饰者模式无疑更加方便。namespace boost{ class thread_group_ex { private: thread_group_ex(thread_... 阅读全文

posted @ 2013-09-10 11:49 小水坝 阅读(1683) 评论(0) 推荐(0) 编辑

导航