Back to index

courier  0.68.2
dotlock.h
Go to the documentation of this file.
00001 #ifndef       dotlock_h
00002 #define       dotlock_h
00003 
00004 
00005 #include      "tempfile.h"
00006 #include      "dotlockrefresh.h"
00007 
00009 //
00010 // Well, here's my attempt to do dot locking.
00011 //
00013 
00014 class DotLock : public TempFile {
00015 
00016        int attemptlock(const char *, const char *);
00017        void   Refreshlock();
00018        DotLockRefresh refresh;
00019        void   dorefresh();
00020 
00021        unsigned      refresh_interval;
00022 public:
00023        DotLock();
00024        ~DotLock();
00025 
00026        void   Lock(const char *);
00027        void   LockMailbox(const char *);
00028        void   Unlock();
00029               //
00030               // Sounds simple, right?  <sigh>
00031 
00032        friend class DotLockRefresh;
00033 
00034 private:
00035 static unsigned GetLockSleep();
00036 static unsigned GetLockTimeout();
00037 static unsigned GetLockRefresh();
00038 static const  char *GetLockExt();
00039 
00040 } ;
00041 #endif