Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::interprocess::interprocess_condition Class Reference

This class is a condition variable that can be placed in shared memory or memory mapped files. More...

#include <interprocess_condition.hpp>

Public Member Functions

 interprocess_condition ()
 Constructs a interprocess_condition. On error throws interprocess_exception. More...
 
 ~interprocess_condition ()
 Destroys *this liberating system resources. More...
 
void notify_one ()
 If there is a thread waiting on *this, change that thread's state to ready. More...
 
void notify_all ()
 Change the state of all threads waiting on *this to ready. More...
 
template<typename L >
void wait (L &lock)
 Releases the lock on the interprocess_mutex object associated with lock, blocks the current thread of execution until readied by a call to this->notify_one() or this->notify_all(), and then reacquires the lock. More...
 
template<typename L , typename Pr >
void wait (L &lock, Pr pred)
 The same as: while (!pred()) wait(lock) More...
 
template<typename L >
bool timed_wait (L &lock, const boost::posix_time::ptime &abs_time)
 Releases the lock on the interprocess_mutex object associated with lock, blocks the current thread of execution until readied by a call to this->notify_one() or this->notify_all(), or until time abs_time is reached, and then reacquires the lock. More...
 
template<typename L , typename Pr >
bool timed_wait (L &lock, const boost::posix_time::ptime &abs_time, Pr pred)
 The same as: while (!pred()) { if (!timed_wait(lock, abs_time)) return pred(); } return true;. More...
 

Friends

class named_condition
 

Detailed Description

This class is a condition variable that can be placed in shared memory or memory mapped files.

Destroys the object of type std::condition_variable_any

Unlike std::condition_variable in C++11, it is NOT safe to invoke the destructor if all threads have been only notified. It is required that they have exited their respective wait functions.

Constructor & Destructor Documentation

boost::interprocess::interprocess_condition::interprocess_condition ( )
inline

Constructs a interprocess_condition. On error throws interprocess_exception.

boost::interprocess::interprocess_condition::~interprocess_condition ( )
inline

Destroys *this liberating system resources.

Member Function Documentation

void boost::interprocess::interprocess_condition::notify_one ( )
inline
template<typename L >
bool boost::interprocess::interprocess_condition::timed_wait ( L &  lock,
const boost::posix_time::ptime abs_time 
)
inline
template<typename L , typename Pr >
bool boost::interprocess::interprocess_condition::timed_wait ( L &  lock,
const boost::posix_time::ptime abs_time,
Pr  pred 
)
inline

The same as: while (!pred()) { if (!timed_wait(lock, abs_time)) return pred(); } return true;.

References boost::interprocess::ipcdetail::spin_condition::timed_wait().

template<typename L , typename Pr >
void boost::interprocess::interprocess_condition::wait ( L &  lock,
Pr  pred 
)
inline

The same as: while (!pred()) wait(lock)

References boost::interprocess::ipcdetail::spin_condition::wait().

Friends And Related Function Documentation

friend class named_condition
friend

The documentation for this class was generated from the following file: