Index: ext/libicpf/src/mutex.h =================================================================== diff -u -N -r2b72d8a437d5843db8c14f68c8aa8484614d2f5b -r12de61bfcf4d1ffef0339bee2e4c4a152209fd30 --- ext/libicpf/src/mutex.h (.../mutex.h) (revision 2b72d8a437d5843db8c14f68c8aa8484614d2f5b) +++ ext/libicpf/src/mutex.h (.../mutex.h) (revision 12de61bfcf4d1ffef0339bee2e4c4a152209fd30) @@ -19,16 +19,11 @@ ***************************************************************************/ /** \file mutex.h * \brief Contains mutex class for thread safe access. + * \see The d_mutex class. */ #ifndef __MUTEX_H__ #define __MUTEX_H__ -#ifdef _WIN32 - #include -#else - #include -#endif - #include "libicpf.h" #include "gen_types.h" @@ -53,48 +48,33 @@ public: /** \name Construction/destruction */ /**@{*/ - /** \brief Standard constructor - */ - mutex(); - mutex(const char_t* pszStr); + mutex(); ///< Standard constructor + mutex(void* /*pUnused*/); ///< Helper constructor, used as a compatibility layer with d_mutex + mutex(const char_t* /*pszStr*/, void* /*pUnused*/); ///< Helper constructor, used as a compatibility layer with d_mutex - /** \brief Standard destructor - */ - ~mutex(); + virtual ~mutex(); ///< Standard destructor /**@}*/ - // standard locking /** \name Locking/unlocking */ /**@{*/ - - /** \brief Locks access to some part of code for the current thread - * - * Locks access to some code using the platform specific functions. - * \return True if succeeded or false if not. - * \note The call under windows always return true. - */ - bool lock(); - - /** \brief Unlock access to some locked part of code - * - * Unlocks access to some code using the platform specific functions. - * \return True if succeeded or false if not. - * \note The call under windows always return true. - */ - bool unlock(); + void lock(); ///< Locks this mutex + void unlock(); ///< Unlocks this mutex + void lock(const char_t* /*pszFile*/, ulong_t /*ulLine*/, const char_t* /*pszFunction*/); ///< Locks this mutex (compatibility layer with d_mutex) + void unlock(const char_t* /*pszFile*/, ulong_t /*ulLine*/, const char_t* /*pszFunction*/); ///< Unlocks this mutex (compatibility layer with d_mutex) /**@}*/ - bool lock(const char_t* pszFile, ulong_t ulLine, const char_t* pszFunction); - bool unlock(const char_t* pszFile, ulong_t ulLine, const char_t* pszFunction); +protected: + void construct(); ///< Helper function - initializes the internal members, used by constructors private: -#ifdef _WIN32 - /// Underlying windows locking structure - CRITICAL_SECTION m_cs; -#else - /// Underlying linux locking structure/handle - pthread_mutex_t m_mutex; -#endif + void* m_pLock; ///< Pointer to a system-specific structure used to lock +//#ifdef _WIN32 +// /// Underlying windows locking structure +// CRITICAL_SECTION m_cs; +//#else +// /// Underlying linux locking structure/handle +// pthread_mutex_t m_mutex; +//#endif }; END_ICPF_NAMESPACE