|
Analysis-Utilities 26.9.9
C++/ROOT utilities for nuclear measurement data analysis
|
RAII guard engaging the same lock used by the open helpers. More...
#include <IOUtils.hpp>
Public Member Functions | |
| ScopedRootLock () | |
| Acquire the shared file-open lock if thread-safe mode is on. | |
| ~ScopedRootLock () | |
| Release the lock if this guard acquired one. | |
RAII guard engaging the same lock used by the open helpers.
Use this around code that constructs TFile objects directly instead of going through OpenForReading() / OpenForWriting(), so that hand-rolled opens serialise against the helpers rather than racing them.
The guard is a no-op when thread-safe mode is off, and the underlying mutex is recursive, so nesting a guard inside a helper call is safe.
Definition at line 113 of file IOUtils.hpp.
| IO::ScopedRootLock::ScopedRootLock | ( | ) |
Acquire the shared file-open lock if thread-safe mode is on.
Definition at line 48 of file IOUtils.cpp.
| IO::ScopedRootLock::~ScopedRootLock | ( | ) |
Release the lock if this guard acquired one.
Definition at line 53 of file IOUtils.cpp.