Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
Mutex Class Reference

Mutual exclusion. More...

#include <Mutex.h>

Public Member Functions

 Mutex ()
 Mutex (const Mutex &)
 Equivalent to default c'tor.
 ~Mutex ()
manipulators
Mutexoperator= (const Mutex &)
 Does nothing.

accessors

class CondVarBase
void lock () const
 Lock the mutex.
void unlock () const
 Unlock the mutex.

Detailed Description

Mutual exclusion.

A non-recursive mutual exclusion object. Only one thread at a time can hold a lock on a mutex. Any thread that attempts to lock a locked mutex will block until the mutex is unlocked. At that time, if any threads are blocked, exactly one waiting thread will acquire the lock and continue running. A thread may not lock a mutex it already owns the lock on; if it tries it will deadlock itself.

Constructor & Destructor Documentation

◆ Mutex() [1/2]

Mutex::Mutex ( )

◆ Mutex() [2/2]

Mutex::Mutex ( const Mutex & )

Equivalent to default c'tor.

Copy c'tor doesn't copy anything. It just makes it possible to copy objects that contain a mutex.

◆ ~Mutex()

Mutex::~Mutex ( )

Member Function Documentation

◆ lock()

void Mutex::lock ( ) const

Lock the mutex.

Locks the mutex, which must not have been previously locked by the calling thread. This blocks if the mutex is already locked by another thread.

(cancellation point)

◆ operator=()

Mutex & Mutex::operator= ( const Mutex & )

Does nothing.

This does nothing. It just makes it possible to assign objects that contain a mutex.

◆ unlock()

void Mutex::unlock ( ) const

Unlock the mutex.

Unlocks the mutex, which must have been previously locked by the calling thread.

◆ CondVarBase

friend class CondVarBase
friend

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