1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // instance.h :
- //
- #if !defined(AGD_INSTANCE_H__54A0DC49_C449_49EB_B41B_ACF625001760__INCLUDED_)
- #define AGD_INSTANCE_H__54A0DC49_C449_49EB_B41B_ACF625001760__INCLUDED_
- #include <unistd.h>
- #include <sys/types.h>
- #include <linux/limits.h>
- #ifdef __cplusplus
- /////////////////////////////////////////////////////////////////////////////
- // instance.h - Declarations:
- #define _USE_BINARY_LOCK 1
- /////////////////////////////////////////////////////////////////////////////
- class CProcessInstance
- {
- public:
- CProcessInstance(void);
- ~CProcessInstance(void);
-
- bool LockInstance(const char *pszUuid);
- void UnlockInstance(void);
- private:
- #if _USE_BINARY_LOCK
- char m_szBinaryPath[PATH_MAX];
- #else // _USE_BINARY_LOCK
- char m_szPidFileDir[PATH_MAX];
- char m_szPidFilePath[PATH_MAX];
- #endif // _USE_BINARY_LOCK
- pid_t m_pid;
- private:
- static int m_fdPid;
- };
- /////////////////////////////////////////////////////////////////////////////
- #endif // __cplusplus
- #endif // !defined(AGD_INSTANCE_H__54A0DC49_C449_49EB_B41B_ACF625001760__INCLUDED_)
|