12 #ifndef ROOT_TLockPath
13 #define ROOT_TLockPath
26 class TLockPath :
public TObject {
32 TLockPath(
const char *path =
"");
33 ~TLockPath() {
if (IsLocked()) Unlock(); }
35 const char *GetName()
const {
return fName; }
36 void SetName(
const char *path) { fName = path; }
38 Int_t Lock(Bool_t shared = kFALSE);
41 Bool_t IsLocked()
const {
return (fLockId > -1); }
43 ClassDef(TLockPath, 0)
46 class TLockPathGuard {
51 TLockPathGuard(TLockPath *l, Bool_t shared = kFALSE) {
52 fLocker = l; fLocker->Lock(shared); }
53 ~TLockPathGuard() { fLocker->Unlock(); }