#include <atomic>
#include <condition_variable>
#include <mutex>
#include <type_traits>
#include <glog/logging.h>
#include <stout/preprocessor.hpp>
Go to the source code of this file.
|
template<typename T > |
Synchronized< T > | synchronize (T *t) |
|
Synchronized< std::atomic_flag > | synchronize (std::atomic_flag *lock) |
|
template<typename T > |
T * | synchronized_get_pointer (T **t) |
|
template<typename T > |
T * | synchronized_get_pointer (T *t) |
|
template<typename CV , typename Lock > |
void | synchronized_wait (CV *cv, Lock *lock) |
| Waits on the condition variable associated with 'lock' which has already been synchronized. More...
|
|
template<> |
void | synchronized_wait (std::condition_variable *cv, std::mutex *mutex) |
|
template<typename Lock > |
void | synchronized_wait (std::condition_variable_any *cv, Lock *lock)=delete |
| There is a known bug around 'std::condition_variable_any' in 'libstdc++' distributed 'devtoolset-2', and also general issues around the use of 'std::condition_variable_any' with 'std::recursive_mutex'. More...
|
|
#define synchronized |
( |
|
m | ) |
|
Value:Synchronized< T > synchronize(T *t)
Definition: synchronized.hpp:52
#define SYNCHRONIZED_VAR
Definition: synchronized.hpp:97
Definition: synchronized.hpp:27
Try< uint32_t > type(const std::string &path)
T * synchronized_get_pointer(T **t)
Definition: synchronized.hpp:78
#define SYNCHRONIZED_LABEL
Definition: synchronized.hpp:98
#define SYNCHRONIZED_PREFIX CAT(__synchronizer_, __LINE__) |
Synchronized<std::atomic_flag> synchronize |
( |
std::atomic_flag * |
lock | ) |
|
|
inline |
template<typename T >
T* synchronized_get_pointer |
( |
T ** |
t | ) |
|
template<typename T >
T* synchronized_get_pointer |
( |
T * |
t | ) |
|
template<typename CV , typename Lock >
void synchronized_wait |
( |
CV * |
cv, |
|
|
Lock * |
lock |
|
) |
| |
Waits on the condition variable associated with 'lock' which has already been synchronized.
Currently, the only supported implementation is for 'std::condition_variable' associated with a 'std::mutex'.
- Parameters
-
cv | The condition variable. |
lock | The lock associated with the condition variable. |
- Precondition
- 'lock' is already owned by the calling thread.
- Postcondition
- 'lock' is still owned by the calling thread.
- Returns
- Nothing.
- Examples:
- /mesos/3rdparty/stout/include/stout/synchronized.hpp.
template<>
void synchronized_wait |
( |
std::condition_variable * |
cv, |
|
|
std::mutex * |
mutex |
|
) |
| |
|
inline |
template<typename Lock >
void synchronized_wait |
( |
std::condition_variable_any * |
cv, |
|
|
Lock * |
lock |
|
) |
| |
|
delete |