libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
Mutex Class Reference

A simple mutual-exclusion lock. More...

#include <Mutex.h>

Public Member Functions

 Mutex (const Mutex &)=delete
 
Mutex & operator= (const Mutex &)=delete
 
void lock ()
 Blocks until the mutex is acquired. Not recursive: locking twice from one thread deadlocks.
 
void unlock ()
 Releases the mutex. Must be called by the thread that locked it.
 

Protected Attributes

void * handle = nullptr
 Backend-assigned mutex handle.
 

Friends

class Cond
 Cond::wait() needs the raw handle to pass to ThreadDriver::waitCond()
 

Detailed Description

A simple mutual-exclusion lock.

Delegates to ThreadDriver for the actual platform primitive.

Definition at line 13 of file Mutex.h.

Constructor & Destructor Documentation

◆ Mutex()

Mutex::Mutex ( )

Definition at line 10 of file Mutex.cpp.

◆ ~Mutex()

Mutex::~Mutex ( )

Definition at line 16 of file Mutex.cpp.

Member Function Documentation

◆ lock()

void Mutex::lock ( )

Blocks until the mutex is acquired. Not recursive: locking twice from one thread deadlocks.

Definition at line 22 of file Mutex.cpp.

◆ unlock()

void Mutex::unlock ( )

Releases the mutex. Must be called by the thread that locked it.

Definition at line 28 of file Mutex.cpp.

Friends And Related Symbol Documentation

◆ Cond

friend class Cond
friend

Cond::wait() needs the raw handle to pass to ThreadDriver::waitCond()

Definition at line 28 of file Mutex.h.

Member Data Documentation

◆ handle

void* Mutex::handle = nullptr
protected

Backend-assigned mutex handle.

Definition at line 29 of file Mutex.h.


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