KaliVeda
Toolkit for HIC analysis
KVLockfile.h
1 /*
2 $Id: KVLockfile.h,v 1.1 2008/02/07 09:25:40 franklan Exp $
3 $Revision: 1.1 $
4 $Date: 2008/02/07 09:25:40 $
5 */
6 
9 
10 #ifndef __KVLOCKFILE_H
11 #define __KVLOCKFILE_H
12 
13 #include "KVString.h"
14 
70 class KVLockfile {
71  KVString fFile;
72  KVString fLockfile;
73  bool have_exec;
74  int sleeptime;
75  int retries;
76  int locktimeout;
77  int suspend;
78  KVString cmd;
79  bool locked;
80 
81  void init();
82  int testlock();
83  void writecmd();
84  Bool_t FindExecutable(TString& exec, const Char_t* path = "$(PATH)");
85 
86 public:
87  KVLockfile(const Char_t* filename = "");
88  virtual ~KVLockfile();
89 
90  void SetSleeptime(int s)
91  {
92  sleeptime = s;
93  };
94  void SetRetries(int r)
95  {
96  retries = r;
97  };
98  void SetTimeout(int t)
99  {
100  locktimeout = t;
101  };
102  void SetSuspend(int s)
103  {
104  suspend = s;
105  };
106 
107  Bool_t Lock(const Char_t* filename = "");
108  Bool_t Release();
109 
110  Bool_t IsLocked() const
111  {
112  return locked;
113  };
114 
115  ClassDef(KVLockfile, 1) //Interface to (Linux) system lockfile command
116 };
117 
118 #endif
ROOT::R::TRInterface & r
bool Bool_t
char Char_t
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Interface to (Linux) system lockfile command.
Definition: KVLockfile.h:70
void SetSleeptime(int s)
Definition: KVLockfile.h:90
Bool_t Release()
Definition: KVLockfile.cpp:195
virtual ~KVLockfile()
Definition: KVLockfile.cpp:39
void SetTimeout(int t)
Definition: KVLockfile.h:98
Bool_t Lock(const Char_t *filename="")
Definition: KVLockfile.cpp:165
void SetRetries(int r)
Definition: KVLockfile.h:94
KVLockfile(const Char_t *filename="")
Default constructor.
Definition: KVLockfile.cpp:25
Bool_t IsLocked() const
Definition: KVLockfile.h:110
void SetSuspend(int s)
Definition: KVLockfile.h:102
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73