Guard Class Reference

List of all members.

Public Member Functions

 Guard (Mutex &m)
 Guard (Mutex *m)

Detailed Description

C++ convienence object for locking a Mutex. Creating a local one of these will lock() the mutex and it means unlock() will be called no matter how a function exits, because the destructor ~Guard() does an unlock().

   static Mutex mutex;
   function() {
     Guard guard(mutex);
     do_stuff;
     throw_exceptions;
     if (test()) return;
     etc;
   }


The documentation for this class was generated from the following file:
Sun Jan 7 00:55:17 2007. FLTK ©2006 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.