cppthread 1.1.16
C++ Thread Library
Public Attributes | List of all members
cppthread::detail::mutex_impl Class Reference

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.
 

Detailed Description

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.

Definition at line 72 of file mutex.cpp.

Member Data Documentation

◆ f_condition

pthread_mutex_t cppthread::detail::mutex_impl::f_condition = pthread_cond_t()

We often have to signal that a thread is done in regard to something or other. That will wake up another thread which can then take over the next step of the work.

The condition is used for that purpose as we can wait on it with the attached mutex.

Definition at line 76 of file mutex.cpp.

◆ f_mutex

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).

Definition at line 75 of file mutex.cpp.


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

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.