它是线程安全的,是阻塞的。
//定义
using sync_send_queue = boost::concurrent::sync_queue<STUDPPacketPtr>; sync_recv_queue m_recv_queue;
//使用
while (true) { STUDPPacketPtr pack; boost::queue_op_status st = m_send_queue.wait_pull(pack); if (st == boost::queue_op_status::closed) { gLog.LogText(LOG_ERROR, "sync send_queue has been closed!!!"); exit(-1); }
}