2013-04-02 50 views

回答

2

该示例并不意味着boost::condition_variable是线程安全的。然而,wait,wait_for,wait_until,notify_onenotify_all是线程安全的成员函数。

Boost.Thread记录它的conformance and extension of the C++11 standard Thread library。它列出了条件变量,类别condition_variable和类别condition_variable_any符合要求。

标准(第30.5-2)的相关部分规定:

条件变量允许的waitwait_forwait_untilnotify_onenotify_all成员函数并发调用。