WvStreams
include/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
14class WvLockFile
15{
16public:
17 WvLockFile(WvStringParm _lockname);
18
20 bool isok();
21
23 bool lock();
24
29 bool unlock();
30
37 pid_t readpid();
38
39protected:
40 WvString lockname;
41};
42
43#endif // __WVLOCKFILE_H
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
pid_t readpid()
Returns one of three things: -1 if the lockfile exists, but is inaccessible.
bool lock()
Creates the lockfile with the current pid.
bool unlock()
Removes the lockfile if present.
bool isok()
Check to make sure no lock is established or that it's owned by us.
WvString is an implementation of a simple and efficient printable-string class.