Common database lock.
Athena has multiple packages that access the database independently, for example IOVDbSvc (via COOL) and RDBAccessSvc. These are all locked internally, but they don't know about each other. Further, some of the underlying database code which they can both use, such as frontier, is not thread-safe. Thus, we can get crashes if, say, IOVDbSvc and RDBAccessSvc are executing in different threads.
To solve this without introducing a depedency between these packages, we introduce this package containing only this lock class. Any Athena package that needs exclusive access to the database layer can then acquire the lock here.
The DBLock object copyable; it holds the underlying lock via a shared_ptr. Further, the underlying mutex is recursive.
Beware of potential deadlocks if this is used in conjunction with another lock. Best to always acquire the locks in the same order.
Definition at line 45 of file DBLock.h.