7 #ifndef MSynch_InprocessRecursiveMutex_h 8 #define MSynch_InprocessRecursiveMutex_h 13 #if defined(_NO_EXCEPTION) 55 pthread_cond_t& irConditionalVariable)
const;
60 pthread_cond_t& irConditionalVariable,
61 const struct timespec& irAbsoluteTimeout)
const;
73 inline void Unlock() throw();
80 pthread_mutex_t mMutex;
92 const int lResult = ::pthread_mutex_destroy(&mMutex);
101 const int lResult = ::pthread_mutex_lock(&mMutex);
111 #if !defined(_NO_EXCEPTION) 112 throw (
"::pthread_mutex_lock failed");
114 printf(
"%s\n",
"MSynch::InprocessRecursiveMutex::Lock: ::pthread_mutex_lock failed");
123 const int lResult = ::pthread_mutex_trylock(&mMutex);
125 if (lResult == EBUSY)
138 #if !defined(_NO_EXCEPTION) 139 throw (
"::pthread_mutex_trylock failed");
141 printf(
"%s\n",
"MSynch::InprocessRecursiveMutex::Lock_NoWait: ::pthread_mutex_trylock failed");
152 const int lResult = ::pthread_mutex_unlock(&mMutex);
185 pthread_cond_t& irConditionalVariable)
const 187 const int lResult = ::pthread_cond_wait(&irConditionalVariable, &mrMyMutex.mMutex);
191 #if !defined(_NO_EXCEPTION) 192 throw (
"::pthread_cond_wait failed");
194 printf(
"%s\n",
"MSynch::InprocessRecursiveMutex::SmartLock::WaitUntilSpuriouslyWokenUp: ::pthread_cond_wait failed");
201 pthread_cond_t& irConditionalVariable,
202 const struct timespec& irAbsoluteTimeout)
const 204 const int lResult = ::pthread_cond_timedwait(&irConditionalVariable, &mrMyMutex.mMutex, &irAbsoluteTimeout);
206 if (lResult == ETIMEDOUT)
210 else if (lResult != 0)
212 #if !defined(_NO_EXCEPTION) 213 throw (
"::pthread_cond_timedwait failed");
215 printf(
"%s\n",
"MSynch::InprocessRecursiveMutex::SmartLock::WaitUntilSpuriouslyWokenUpOrTimeoutExpired: ::pthread_cond_timedwait failed");
224 #endif // MSynch_InprocessRecursiveMutex_h void Unlock()
Definition: InprocessRecursiveMutex.h:149
bool Lock_NoWait()
Definition: InprocessRecursiveMutex.h:121
bool WaitUntilSpuriouslyWokenUpOrTimeoutExpired(pthread_cond_t &irConditionalVariable, const struct timespec &irAbsoluteTimeout) const
Definition: InprocessRecursiveMutex.h:200
#define _ASSERT(x)
Definition: Asserte.h:34
Definition: CriticalSectionImpl.h:20
SmartLock(InprocessRecursiveMutex &irMutex)
Definition: InprocessRecursiveMutex.h:167
void Lock()
Definition: InprocessRecursiveMutex.h:99
friend class BootstrapCriticalSectionImpl
Definition: InprocessRecursiveMutex.h:78
void Unlock()
Definition: InprocessRecursiveMutex.h:45
Definition: InprocessRecursiveMutex.h:25
Definition: ReferenceCountedImpl.h:18
void WaitUntilSpuriouslyWokenUp(pthread_cond_t &irConditionalVariable) const
this method is here only for the ManualEvent
Definition: InprocessRecursiveMutex.h:184
Definition: InprocessRecursiveMutex.h:31
InprocessRecursiveMutex()
~InprocessRecursiveMutex()
Definition: InprocessRecursiveMutex.h:90
~SmartLock()
Definition: InprocessRecursiveMutex.h:175
void Lock()
Definition: InprocessRecursiveMutex.h:38