Parallel Make  1.0
My implementation of make utility, which can run in multiple threads according to user request.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
mutex Class Reference

Wrapper around pthread_mutex. More...

#include <mutex.hpp>

Public Member Functions

 mutex ()
 Basic constructor for mutex. More...
 
 mutex (mutex &&)=default
 Defaulted move constructor. More...
 
mutex & operator= (mutex &&)=default
 Defaulted move assignment. More...
 
 mutex (const mutex &)=delete
 Deleted copy constructor. More...
 
mutex & operator= (const mutex &)=delete
 Deleted copy assignment. More...
 
 ~mutex ()
 Destructor for mutex, which frees inner structures. More...
 
bool lock ()
 
bool try_lock ()
 
bool unlock ()
 

Friends

class condition_variable
 

Detailed Description

Wrapper around pthread_mutex.

!

Constructor & Destructor Documentation

mutex::mutex ( )
inline

Basic constructor for mutex.

mutex::mutex ( mutex &&  )
default

Defaulted move constructor.

mutex::mutex ( const mutex &  )
delete

Deleted copy constructor.

mutex::~mutex ( )
inline

Destructor for mutex, which frees inner structures.

Member Function Documentation

bool mutex::lock ( )
inline

Locks the mutex. Will block if mutex is already locked.

Returns
true on success, false otherwise.
mutex& mutex::operator= ( mutex &&  )
default

Defaulted move assignment.

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

Deleted copy assignment.

bool mutex::try_lock ( )
inline

Tries to lock the mutex. If mutex is already locked, function returns immediately.

Returns
true if mutex was locked by the call, false if mutex is already locked.
bool mutex::unlock ( )
inline

Unlocks the mutex.

Returns
true if unlock was successful, false if thread does not own the mutex.

Friends And Related Function Documentation

friend class condition_variable
friend

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