[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MutexLock added to gc_util.h



Hello People,

I have added a simple class called MutexLock, to gc_util.cpp. It takes the address of a pthread mutex in the constructor, which it aquires the lock for immediatly. The lock
is released in the destructor. The idea is that all you have to do to protect a function (or block of code) with a mutex lock is to say something like:

MutexLock ml(&myMutex);

Regards, Henrik

___________________________________________________________
Henrik Nordberg <HNordberg@lbl.gov> http://nordberg.lbl.gov
Scientific Data Management Research Group
Lawrence Berkeley Laboratory