21#if defined(R__WIN32) && !defined(R__WINGCC)
26#define O_CREAT _O_CREAT
40 Warning(
"TLockPath",
"problems expanding path '%s'",
fName.Data());
47 if (
gSystem->AccessPathName(pname))
48 fLockId = open(pname, O_CREAT | O_RDWR, 0644);
53 SysError(
"Lock",
"cannot open lock file %s", pname);
58 Info(
"Lock",
"%d: locking file %s ...",
gSystem->GetPid(), pname);
60#if !defined(R__WIN32) && !defined(R__WINGCC)
61 int op = (shared) ? LOCK_SH : LOCK_EX ;
63 SysError(
"Lock",
"error locking %s", pname);
71 Info(
"Lock",
"%d: file %s locked",
gSystem->GetPid(), pname);
89#if !defined(R__WIN32) && !defined(R__WINGCC)
90 if (flock(
fLockId, LOCK_UN) == -1) {
R__EXTERN TSystem * gSystem
TLockPath(const char *path="")
Locks the directory.
Int_t Lock(Bool_t shared=kFALSE)
const char * GetName() const override
Returns name of object.
Int_t Unlock()
Unlock the directory.
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.