WvStreams
wvlockfile.h
1 /* -*- Mode: C++ -*-
2  * Worldvisions Weaver Software:
3  * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4  *
5  * A simple lockfile class using WvStreams.
6  */
7 
8 #ifndef __WVLOCKFILE_H
9 #define __WVLOCKFILE_H
10 
11 #include "wvfile.h"
12 
13 
15 {
16 public:
17  WvLockFile(WvStringParm _lockname);
18 
20  bool isok();
21 
23  bool lock();
24 
29  bool unlock();
30 
37  pid_t readpid();
38 
39 protected:
40  WvString lockname;
41 };
42 
43 #endif // __WVLOCKFILE_H
WvLockFile::unlock
bool unlock()
Removes the lockfile if present.
Definition: wvlockfile.cc:41
WvLockFile
Definition: wvlockfile.h:14
WvLockFile::isok
bool isok()
Check to make sure no lock is established or that it's owned by us.
Definition: wvlockfile.cc:20
WvString
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:329
WvLockFile::readpid
pid_t readpid()
Returns one of three things: -1 if the lockfile exists, but is inaccessible.
Definition: wvlockfile.cc:52
WvLockFile::lock
bool lock()
Creates the lockfile with the current pid.
Definition: wvlockfile.cc:27