Scopira 20080306

scopira::tool::locker Class Reference

#include <mutex_pthreads.h>

List of all members.

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

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

Locks the given mutex on construction.

Author:
Aleksander Demko

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

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

Unlocks the mutex on destruction.

Author:
Aleksander Demko

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

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

Locks the given mutex on construction.

Author:
Aleksander Demko

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

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: