chxresourcetoken.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:1k
- /*============================================================================*
- *
- * (c) 1995-2002 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *============================================================================*/
- #if !defined(CHXRESOURCETOKEN_INCLUDED__)
- #define CHXRESOURCETOKEN_INCLUDED__
- #include <e32std.h>
- // class CHXResourceToken
- class CHXResourceToken
- {
- public:
- // ctor and dtor
- CHXResourceToken();
- ~CHXResourceToken();
- void ConstructL(const TDesC& name, TInt maxUserCount = 1);
- private:
- // disallow assignment and copy
- CHXResourceToken(const CHXResourceToken& rhs);
- CHXResourceToken& operator=(const CHXResourceToken& rhs);
- public:
- // methods
- bool TryAcquire();
- void Release();
- private:
- // implementation
- TInt OpenSemaphoreL(const TDesC& name, TInt maxUserCount);
- private:
- // data
- bool m_bGotIt;
- bool m_bIsOpen;
-
- RSemaphore m_sem;
- };
- #endif // CHXRESOURCETOKEN_INCLUDED__