/usr/include/root/TLockFile.h is in libroot-io-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | // @(#)root/io:$Id$
// Author: Jan Fiete Grosse-Oetringhaus, 04.06.07
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TLockFile
#define ROOT_TLockFile
//////////////////////////////////////////////////////////////////////////
// //
// TLockFile //
// //
// Lock an object using a file. //
// Constructor blocks until lock is obtained. Lock is released in the //
// destructor. //
// //
// Use it in scope-blocks like: //
// { //
// TLockFile lock("path.to.lock.file"); //
// // do something you need the lock for //
// } // lock is automatically released //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
class TLockFile : public TObject {
private:
TLockFile(const TLockFile&); // not implemented
TLockFile& operator=(const TLockFile&); // not implemented
protected:
TString fPath; // path to file holding the lock
Bool_t Lock(const char *path, Int_t timeLimit);
public:
TLockFile(const char *path, Int_t timeLimit = 0);
virtual ~TLockFile();
ClassDef(TLockFile, 0) //Lock an object using a file
};
#endif
|