Add LockedHandle class, that locks/unlocks access around ptr
usage:
```c++
std::mutex the_mutex;
Obj *o = new Obj();
LockedHandle<Obj> lh(o, &the_mutex);
o->doSomething();
```
access to `o->doSomething()` will be protected by a mutex.
uses a `std::mutex` by default, but this can be overridden via a second
template arg:
```c++
LockedHandle<Obj_TYPE, Mutex_TYPE> lh(obj, &mut);
```
CPPUnit test is also provided
modified: GaudiKernel/CMakeLists.txt
new file: GaudiKernel/GaudiKernel/LockedHandle.h
new file: GaudiKernel/tests/src/test_LockedHandle.cpp
See merge request !195
Loading
Please sign in to comment