50 Info(
"TLockFile",
"did not aquire lock %s, sleeping...",
fPath.Data());
61 Info(
"~TLockFile",
"releasing lock %s",
fPath.Data());
72 if (
gSystem->GetPathInfo(path, 0, (
Long_t*) 0, 0, &modTime) == 0) {
75 Info(
"Lock",
"%s modification time %ld, %ld seconds ago", path, modTime, time(0) - modTime);
76 if (time(0) - modTime > timeLimit){
79 Info(
"Lock",
"time expired, removed %s", path);
87 spath +=
"?filetype=raw";
100 Info(
"Lock",
"obtained lock %s", path);
R__EXTERN TSystem * gSystem
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
void Close(Option_t *option="") override
Close a file.
A scoped lock based on files.
~TLockFile() override
Destructor. Releases the lock.
TString fPath
Path to file holding the lock.
TLockFile(const TLockFile &)=delete
Bool_t Lock(const char *path, Int_t timeLimit)
Internal function that locks with the given path.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.