diff options
Diffstat (limited to 'maildrop/dotlock.h')
| -rw-r--r-- | maildrop/dotlock.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/maildrop/dotlock.h b/maildrop/dotlock.h new file mode 100644 index 0000000..67c22b0 --- /dev/null +++ b/maildrop/dotlock.h @@ -0,0 +1,41 @@ +#ifndef dotlock_h +#define dotlock_h + + +#include "tempfile.h" +#include "dotlockrefresh.h" + +///////////////////////////////////////////////////////////////////////////// +// +// Well, here's my attempt to do dot locking. +// +///////////////////////////////////////////////////////////////////////////// + +class DotLock : public TempFile { + + int attemptlock(const char *, const char *); + void Refreshlock(); + DotLockRefresh refresh; + void dorefresh(); + + unsigned refresh_interval; +public: + DotLock(); + ~DotLock(); + + void Lock(const char *); + void LockMailbox(const char *); + void Unlock(); + // + // Sounds simple, right? <sigh> + + friend class DotLockRefresh; + +private: +static unsigned GetLockSleep(); +static unsigned GetLockTimeout(); +static unsigned GetLockRefresh(); +static const char *GetLockExt(); + +} ; +#endif |
