Generated on for Gecode by doxygen 1.17.0

A mutex for mutual exclausion among several threads. More...

#include <gecode/support/thread.hpp>

Public Member Functions

 Mutex (void)
 Initialize mutex.
void acquire (void)
 Acquire the mutex and possibly block.
bool tryacquire (void)
 Try to acquire the mutex, return true if successful.
void release (void)
 Release the mutex.

Static Public Member Functions

static void * operator new (size_t s)
 Allocate memory from heap.
static void operator delete (void *p)
 Free memory allocated from heap.

Detailed Description

A mutex for mutual exclausion among several threads.

It is not specified whether the mutex is recursive or not. Likewise, there is no guarantee of fairness among the blocking threads.

Definition at line 78 of file thread.hpp.

Constructor & Destructor Documentation

◆ Mutex()

Gecode::Support::Mutex::Mutex ( void )
inline

Initialize mutex.

Definition at line 64 of file thread.hpp.

Member Function Documentation

◆ acquire()

void Gecode::Support::Mutex::acquire ( void )
inline

Acquire the mutex and possibly block.

Definition at line 70 of file thread.hpp.

◆ tryacquire()

bool Gecode::Support::Mutex::tryacquire ( void )
inline

Try to acquire the mutex, return true if successful.

Definition at line 81 of file thread.hpp.

◆ release()

void Gecode::Support::Mutex::release ( void )
inline

Release the mutex.

Definition at line 94 of file thread.hpp.

◆ operator new()

void * Gecode::Support::Mutex::operator new ( size_t s)
inlinestatic

Allocate memory from heap.

Definition at line 105 of file thread.hpp.

◆ operator delete()

void Gecode::Support::Mutex::operator delete ( void * p)
inlinestatic

Free memory allocated from heap.

Definition at line 110 of file thread.hpp.


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