Xmipp
v3.23.11-Nereus
|
#include <xmipp_threads.h>
Public Member Functions | |
Condition () | |
~Condition () | |
void | lock () |
void | unlock () |
void | wait () |
void | signal () |
void | broadcast () |
Class wrapping around the pthreads condition. This class will provide a more object oriented implementation of a condition variable to achieve synchronization between threads.
Definition at line 88 of file xmipp_threads.h.
Condition::Condition | ( | ) |
Default constructor. This constructor just initialize the pthread_mutex_t structure with its defaults values, just like static initialization with PTHREAD_MUTEX_INITIALIZER
Definition at line 58 of file xmipp_threads.cpp.
Condition::~Condition | ( | ) |
void Condition::broadcast | ( | ) |
Send the signal to all waiting threads.
Definition at line 90 of file xmipp_threads.cpp.
void Condition::lock | ( | ) |
void Condition::signal | ( | ) |
Function to notify the condition was met. Thread that can be waiting in the condition will be awaked.
Definition at line 85 of file xmipp_threads.cpp.
void Condition::unlock | ( | ) |
void Condition::wait | ( | ) |
Function to be call from a thread to wait on the condition. This function should be called after acquiring the Condition lock...after that, will block the threads until the condition be signaled.
Definition at line 80 of file xmipp_threads.cpp.