Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Lock Factories - EXTENSION

Non Member Function make_unique_lock(Lockable&)
Non Member Function make_unique_lock(Lockable&,tag)
Non Member Function make_unique_locks(Lockable& ...)
namespace boost
{

  template <typename Lockable>
  unique_lock<Lockable> make_unique_lock(Lockable& mtx); // EXTENSION

  template <typename Lockable>
  unique_lock<Lockable> make_unique_lock(Lockable& mtx, adopt_lock_t); // EXTENSION
  template <typename Lockable>
  unique_lock<Lockable> make_unique_lock(Lockable& mtx, defer_lock_t); // EXTENSION
  template <typename Lockable>
  unique_lock<Lockable> make_unique_lock(Lockable& mtx, try_to_lock_t); // EXTENSION

#if ! defined(BOOST_THREAD_NO_MAKE_UNIQUE_LOCKS)
  template <typename ...Lockable>
  std::tuple<unique_lock<Lockable> ...> make_unique_locks(Lockable& ...mtx); // EXTENSION
#endif
}
template <typename Lockable>
unique_lock<Lockable> make_unique_lock(Lockable& mtx); // EXTENSION

Returns:

a boost::unique_lock as if initialized with unique_lock<Lockable>(mtx).

Throws:

Any exception thrown by the call to boost::unique_lock<Lockable>(mtx).

template <typename Lockable>
unique_lock<Lockable> make_unique_lock(Lockable& mtx, adopt_lock_t tag); // EXTENSION

template <typename Lockable>
unique_lock<Lockable> make_unique_lock(Lockable& mtx, defer_lock_t tag); // EXTENSION

template <typename Lockable>
unique_lock<Lockable> make_unique_lock(Lockable& mtx, try_to_lock_t tag); // EXTENSION

Returns:

a boost::unique_lock as if initialized with unique_lock<Lockable>(mtx, tag).

Throws:

Any exception thrown by the call to boost::unique_lock<Lockable>(mtx, tag).

template <typename ...Lockable>
std::tuple<unique_lock<Lockable> ...> make_unique_locks(Lockable& ...mtx); // EXTENSION

Effect:

Locks all the mutexes.

Returns:

a std::tuple of unique boost::unique_lock owning each one of the mutex.

Throws:

Any exception thrown by boost::lock(mtx...).


PrevUpHomeNext