$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Dhanvi Kapila (boostguy_at_[hidden])
Date: 2006-02-16 19:32:34
Hi :
 I have this piece of code for mutex operations.  is this code 
thread-safe ? I plan to use this code in threads...
------------------------------------
class BoostMutexLock
{
   public :
        void lock() {
               lk = new boost::mutex::scoped_lock(global_mutex);
       }
        void unlock() {
              delete lk;
        }
  BoostMutexLock() : lk( 0 ) { }
  ~BoostMutexLock() { }
private:
      boost::mutex global_mutex;
      boost::mutex::scoped_lock* lk;
};
------------------------------------------------------
I appreciate all the help.. How do I know to check for thread-safety in 
a code ? Are there any documents?  I have checked online and have some 
links, but havent found documents which provide examples and explain.. 
such a document would be really useful.
Thanks...
Dhanvi