Boost C++ Libraries: Ticket #13162: Sharable Lock And Upgradable Lock documentation https://svn.boost.org/trac10/ticket/13162 <p> <a href="http://www.boost.org/doc/libs/1_64_0/doc/html/interprocess/synchronization_mechanisms.html#interprocess.synchronization_mechanisms.sharable_upgradable_mutexes.sharable_upgradable_locks">http://www.boost.org/doc/libs/1_64_0/doc/html/interprocess/synchronization_mechanisms.html#interprocess.synchronization_mechanisms.sharable_upgradable_mutexes.sharable_upgradable_locks</a> </p> <blockquote> <p> The documentation of the interprocess sharable and upgradable locks state that "Boost.Interprocess mutexes are best used with the scoped_lock utility, and this class only offers exclusive locking.". </p> <blockquote> <p> Then goes on to explain to use sharable_lock and upgradable_lock. Then shows some examples; but the example for a timed lock is wrong or misleading: </p> </blockquote> </blockquote> <p> { </p> <blockquote> <p> boost::posix_time::ptime abs_time = ... </p> </blockquote> <blockquote> <p> <em>This will call timed_lock_sharable() scoped_lock&lt;<a class="missing wiki">SharableOrUpgradableMutex</a>&gt; lock(sh_or_up_mutex, abs_time); </em></p> </blockquote> <blockquote> <p> <em>Check if the mutex has been successfully locked if(lock){ </em></p> <blockquote> <p> <em>Some code </em></p> </blockquote> <p> } <em>If the mutex was locked it will be unlocked </em></p> </blockquote> <p> } </p> <blockquote> <p> The example basically says that the scoped_lock will acquire a sharable lock (saying that it will call timed_lock_sharable())! This should read "sharable_lock&lt;..." instead of "scoped_lock&lt;..." same with upgradable lock. </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13162 Trac 1.4.3