WvStreams
debian/libwvstreams-dev/usr/include/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{
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.
Definition wvlockfile.cc:52
bool lock()
Creates the lockfile with the current pid.
Definition wvlockfile.cc:27
bool unlock()
Removes the lockfile if present.
Definition wvlockfile.cc:41
bool isok()
Check to make sure no lock is established or that it's owned by us.
Definition wvlockfile.cc:20
WvString is an implementation of a simple and efficient printable-string class.