[Boost-bugs] [Boost C++ Libraries] #13162: Sharable Lock And Upgradable Lock documentation

Subject: [Boost-bugs] [Boost C++ Libraries] #13162: Sharable Lock And Upgradable Lock documentation
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-08-14 11:10:56


#13162: Sharable Lock And Upgradable Lock documentation
------------------------------+----------------------------
 Reporter: anonymous | Owner: Ion Gaztañaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.64.0 | Severity: Not Applicable
 Keywords: boost docs |
------------------------------+----------------------------
 http://www.boost.org/doc/libs/1_64_0/doc/html/interprocess/synchronization_mechanisms.html#interprocess.synchronization_mechanisms.sharable_upgradable_mutexes.sharable_upgradable_locks

  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.".
   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:
 {
    boost::posix_time::ptime abs_time = ...

    //This will call timed_lock_sharable()
    scoped_lock<SharableOrUpgradableMutex> lock(sh_or_up_mutex, abs_time);

    //Check if the mutex has been successfully locked
    if(lock){
       //Some code
    }
    //If the mutex was locked it will be unlocked
 }

   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<..." instead of "scoped_lock<..." same
 with upgradable lock.

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13162>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-08-14 11:17:37 UTC