boostorg / thread

Boost.org thread module
http://boost.org/libs/thread
197 stars 162 forks source link

synchronized_value documentation example fails to compile #374

Open Jacob-Burckhardt opened 1 year ago

Jacob-Burckhardt commented 1 year ago

The documentation gives the following example. u1 and u2 appear to be variable names, yet they appear to be undeclared.

  synchronized_value<std::queue<MessageType> > q1,q2;
  void transferMessage()
  {
    auto lks = synchronize(u1,u2); // dead-lock free algorithm

    if(!std::get<1>(lks)->empty())
    {
      std::get<2>(lks)->push_back(u1->front());
      std::get<1>(lks)->pop_front();
    }
  }