AppCore
Loading...
Searching...
No Matches
efilelock.h
Go to the documentation of this file.
1#ifndef EFILELOCK_H
2#define EFILELOCK_H
3
4#include <unistd.h>
5#include <string.h>
6#include <fcntl.h>
7
8namespace EM
9{
10 namespace EventDownloader
11 {
12 class EFileLock
13 {
14 private:
15 char *m_path;
16 int m_file;
17
18 public:
20 EFileLock( const char *path);
22
23 bool setPath( const char *path);
24 char* getPath();
25
26 // tries to gain the lock (returns true if succeeded)
27 // multiple call of this method is OK
28 bool lock();
29
30 // true = somebody else has lock
31 // false = unlocked or we have lock
32 bool check();
33
34 // tries to release the lock (returns true if success)
35 bool unlock();
36 };
37
38 }
39}
40
41#endif
bool setPath(const char *path)
SYSTEM INCLUDES.
Definition CardFacadeManagerXML.h:7
Definition EventDownloaderH.h:12