Acquire the mutex. (blocking) phMutex is a recursive mutex. The number of times this method is called should also correspond with the number of times the phMutex::unlock() method is called.
The recursive feature allows nested locking of the mutex. Nested locking allows the ability to lock "this" at the begining of every method paired with releasing the mutex before returning from any inheriting object's method in which the mutex was successfully acquired. If the mutex wasn't successfully acquired in a method, it shouldn't be unlocked in that method. Unlocking in one scope when the mutex wasn't successfully acquired in that scope could cause the scoped locking to be mismatched and releasing of the mutex earlier than expected.
- The success of the method.
- Return values:
|phSUCCESS ||The thread locked the mutex object. |
|phFAIL ||The thread failed to execute the method. This can be for a couple reasons:|
- the thread couldn't acquire the mutex at all
- the object is invalid/unallocated/uninitialized on the heap or stack
- the object is allocated statically on the stack and the stack was over run because the system doesn't have a large enough stack size.
Definition at line 358 of file phMutex.cpp.