Ticket #2639: lock_options.patch

File lock_options.patch, 955 bytes (added by viboes, 12 years ago)
  • mutex_concepts.qbk

     
    310310
    311311[section:locks Lock Types]
    312312
     313[section:lock_tags Lock option tags]
     314
     315    #include <boost/thread/locks.hpp>
     316
     317    struct defer_lock_t {};
     318    struct try_to_lock_t {};
     319    struct adopt_lock_t {};
     320   
     321    const defer_lock_t defer_lock;
     322    const try_to_lock_t try_to_lock;
     323    const adopt_lock_t adopt_lock;
     324
     325These tags are used in scoped locks constructors to specify a specific behavior.
     326
     327*`defer_lock_t`: is used to construct the scoped lock without locking it.
     328*`try_to_lock_t`: is used to construct the scoped lock trying to lock it.
     329*`adopt_lock_t`: is used to construct the scoped lock without locking it but adopting ownership.
     330
     331[endsect]
     332
    313333[section:lock_guard Class template `lock_guard`]
    314334
    315335    #include <boost/thread/locks.hpp>