FRI-OS
Classes | Public Member Functions | List of all members
mutex Class Reference

Wrapper around POSIX mutexes. More...

#include <frios/posix/threads/mutex.hpp>

Classes

struct  init_error
 Exception class for mutex initialization errors. More...
 
class  lock
 Class locking a mutex on construction and unlocking on destruction. More...
 
struct  lock_error
 Exception class for locking operation errors. More...
 
struct  locked
 Exception class indicating that a mutex is already locked. More...
 
struct  try_lock
 Class optionally locking a mutex if it is free. More...
 
class  unlock
 Class unlocking a mutex on construction and locking on destruction. More...
 
struct  unlock_error
 Exception class for unlocking operation errors. More...
 

Public Member Functions

 mutex (void)
 Default construction. More...
 
 mutex (const mutex_attr &attributes)
 Construction from mutex attributes. More...
 
 mutex (mutex &&tmp)
 Mutexes are movable.
 
 ~mutex (void)
 Destructor frees any resources related to the mutex.
 

Detailed Description

Wrapper around POSIX mutexes.

The mutex class wraps a POSIX mutex, which is initialized in this class' constructor and destroyed in the destructor.

Examples:
example/posix/threads-bingo_detached.cpp, and example/posix/threads-producer_consumer.cpp.

Constructor & Destructor Documentation

mutex ( void  )

Default construction.

Exceptions
init_error
mutex ( const mutex_attr attributes)

Construction from mutex attributes.

Exceptions
init_error

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