fltk::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 fltk::Mutex mutex;
   function() {
     fltk::Guard guard(mutex);
     do_stuff;
     throw_exceptions;
     if (test()) return;
     etc;
   }

Wed Jun 17 08:58:18 2009. FLTK ©2007 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.