Wait points that blocks the execution of a thread at a specific code point until an event occurs.
The cb_waitpoint mechanism bundles the pthread_cond with pthread_mutex to ensure thread safety and re-entrant blocking mechanism. Ideally, when pthread_cond is used, it is always required to guard its access with pthread_mutex. This waitpoint abstracts the use of pthread_cond and pthread_mutex into single waitpoint structure.
Data Fields | |
CB_THREAD_MUTEX_T | lock |
CB_THREAD_COND_T | condition |
uint64_t | time |
bool | wakeup |
CB_THREAD_MUTEX_T cb_waitpoint_t::lock |
mutual exclusion lock
CB_THREAD_COND_T cb_waitpoint_t::condition |
lock condition
uint64_t cb_waitpoint_t::time |
lock time
bool cb_waitpoint_t::wakeup |
boolean if waitpoint is unlocked