摘要: [cpp] view plaincopyprint?namespace{//strand提供串行执行,能够保证线程安全,同时被post或dispatch的方法,不会被并发的执行.//io_service不能保证线程安全boost::asio::io_servicem_service;boost::asio::strandm_strand(m_service);boost::mutexm_mutex;voidprint(intid){//boost::mutex::scoped_locklock(m_mutex);staticintcount=0;PRINT_DEBUG("id:&qu 阅读全文
posted @ 2014-01-09 18:18 孤火 阅读(1679) 评论(1) 推荐(0) 编辑