#ifndef __RESOURCE_LOCKER_HPP__ #define __RESOURCE_LOCKER_HPP__ #include <stdio.h> #include <string> using std::string; class Resource_locker { private: int _fd; bool _locked; int _pid; Resource_locker(const Resource_locker& orig){} Resource_locker& operator = (const Resource_locker& orig){return *this;} public: Resource_locker(const string& filename, const string& path = "/var/lock/"); ~Resource_locker(); void lock(); void unlock(); bool trylock(); }; #endif //__RESOURCE_LOCKER_HPP__