Scopira  20080306
scopira::tool::locker Class Reference

#include <mutex_pthreads.h>

Public Member Functions

 locker (mutex &mut)
 
 ~locker ()
 
 locker (mutex &mut)
 
 ~locker ()
 

Detailed Description

This automatic variable locks and unllocks mutexs on construction and destruction. This is for auto-pointer like critical sections in scope blocks and makes sur eyou don't forget to unlock a mutex on ALL scope block exits.

Author
Aleksander Demko

Constructor & Destructor Documentation

◆ locker() [1/2]

scopira::tool::locker::locker ( mutex mut)
inline

Locks the given mutex on construction.

Author
Aleksander Demko

References scopira::tool::mutex::lock().

◆ ~locker() [1/2]

scopira::tool::locker::~locker ( )
inline

Unlocks the mutex on destruction.

Author
Aleksander Demko

References scopira::tool::mutex::unlock().

◆ locker() [2/2]

scopira::tool::locker::locker ( mutex mut)
inline

Locks the given mutex on construction.

Author
Aleksander Demko

References scopira::tool::mutex::lock().

◆ ~locker() [2/2]

scopira::tool::locker::~locker ( )
inline

Unlocks the mutex on destruction.

Author
Aleksander Demko

References scopira::tool::mutex::unlock().


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