|
cppthread 1.1.16
C++ Thread Library
|
The implementation of the mutex. More...
Public Attributes | |
| pthread_cond_t | f_condition = pthread_cond_t() |
| Condition linked to the mutex to support signalling. | |
| pthread_mutex_t | f_mutex = pthread_mutex_t() |
| Mutex to support guards & signals. | |
We have an internal implementation of the mutex to avoid leaking the pthread library to the outside.
The class holds a mutex and a condition which we use to wait in various circumstances such as when we pop items from a currently empty fifo.
| pthread_mutex_t cppthread::detail::mutex_impl::f_condition = pthread_cond_t() |
| pthread_mutex_t cppthread::detail::mutex_impl::f_mutex = pthread_mutex_t() |
This is the actual system mutex. It is useful to protect areas of code that only one thread is allowed to access at a time.
The mutex also supports a condition that it can wait on and signal. This is useful to signal a new state such as the end of FIFO as any thread waiting on that FIFO now needs to wake up a give up (no more messages will be sent to the FIFO).
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.