Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | List of all members
honey::Mutex Class Reference

A thread lock where the lock is acquired by suspending thread execution until it becomes available. More...

#include <Mutex.h>

Inheritance diagram for honey::Mutex:
Inheritance graph
[legend]
Collaboration diagram for honey::Mutex:
Collaboration graph
[legend]

Public Types

typedef Super::Handle Handle
 
typedef UniqueLock< MutexScoped
 

Public Member Functions

 Mutex ()=default
 
 Mutex (const Mutex &)
 Can't copy, silently inits to default. More...
 
Mutexoperator= (const Mutex &)
 Can't copy, silently does nothing. More...
 
void lock ()
 Acquire the lock. Thread suspends until lock becomes available. More...
 
void unlock ()
 Release the lock. More...
 
bool tryLock ()
 Attempt to acquire the lock, returns immediately. Returns true if the lock was acquired, false otherwise. More...
 
Handlehandle ()
 Get platform handle. More...
 

Detailed Description

A thread lock where the lock is acquired by suspending thread execution until it becomes available.

Use when threads are expected to acquire the lock for a long time before releasing.
The lock is non-recursive: a thread can only acquire the lock once, a second attempt without unlocking first will deadlock.

Member Typedef Documentation

typedef Super::Handle honey::Mutex::Handle

Constructor & Destructor Documentation

honey::Mutex::Mutex ( )
default
honey::Mutex::Mutex ( const Mutex )
inline

Can't copy, silently inits to default.

Member Function Documentation

Handle& honey::Mutex::handle ( )
inline

Get platform handle.

void honey::Mutex::lock ( )
inline

Acquire the lock. Thread suspends until lock becomes available.

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

Can't copy, silently does nothing.

bool honey::Mutex::tryLock ( )
inline

Attempt to acquire the lock, returns immediately. Returns true if the lock was acquired, false otherwise.

void honey::Mutex::unlock ( )
inline

Release the lock.


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