Electronics and Software
Engineering Innovation
Beam-lib  2.15.1

#include <BMutex.h>

Inheritance diagram for BMutex:
BStringMutex

Public Types

enum  Type { Normal, Recursive }
 

Public Member Functions

 BMutex (Type type=Normal)
 
 BMutex (const BMutex &mutex)
 
 ~BMutex ()
 
int lock ()
 Set lock, wait as necessary. More...
 
int timedLock (int timeoutUs)
 Set lock, wait as necessary but timeout after given time. More...
 
int unlock ()
 Unlock the lock. More...
 
int tryLock ()
 Test the lock. More...
 
BMutexoperator= (const BMutex &mutex)
 

Private Attributes

pthread_mutex_t omutex
 

Detailed Description

Mutex class Note these are recursive Mutexes and so you need to make sure the number of unlocks equals the number of locks.

Member Enumeration Documentation

◆ Type

Enumerator
Normal 
Recursive 

Constructor & Destructor Documentation

◆ BMutex() [1/2]

BMutex::BMutex ( Type  type = Normal)

◆ BMutex() [2/2]

BMutex::BMutex ( const BMutex mutex)

◆ ~BMutex()

BMutex::~BMutex ( )

Member Function Documentation

◆ lock()

int BMutex::lock ( )

Set lock, wait as necessary.

◆ operator=()

BMutex & BMutex::operator= ( const BMutex mutex)

◆ timedLock()

int BMutex::timedLock ( int  timeoutUs)

Set lock, wait as necessary but timeout after given time.

◆ tryLock()

int BMutex::tryLock ( )

Test the lock.

◆ unlock()

int BMutex::unlock ( )

Unlock the lock.

Member Data Documentation

◆ omutex

pthread_mutex_t BMutex::omutex
private

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