KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
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
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
86public:
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
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)
Interface to (Linux) system lockfile command.
Definition KVLockfile.h:70
Bool_t FindExecutable(TString &exec, const Char_t *path="$(PATH)")
copied from KVBase to avoid circular dependency
void SetSleeptime(int s)
Definition KVLockfile.h:90
Bool_t Release()
int locktimeout
time after which lock automatically opens
Definition KVLockfile.h:76
int retries
number of times to retry
Definition KVLockfile.h:75
KVString fFile
name of file
Definition KVLockfile.h:71
bool locked
kTRUE when Lock() has been called successfully
Definition KVLockfile.h:79
virtual ~KVLockfile()
int sleeptime
time to wait before retrying lock
Definition KVLockfile.h:74
void writecmd()
Writes lockfile command with current values of parameters.
int suspend
suspend time after timeout
Definition KVLockfile.h:77
KVString fLockfile
full path to lockfile executable (if defined)
Definition KVLockfile.h:72
void SetTimeout(int t)
Definition KVLockfile.h:98
Bool_t Lock(const Char_t *filename="")
KVString cmd
command to execute
Definition KVLockfile.h:78
void SetRetries(int r)
Definition KVLockfile.h:94
Bool_t IsLocked() const
Definition KVLockfile.h:110
bool have_exec
kTRUE if lockfile found on system
Definition KVLockfile.h:73
void init()
void SetSuspend(int s)
Definition KVLockfile.h:102
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition KVString.h:73