Changeset 1267
- Timestamp:
- 06/24/08 04:36:36 (16 years ago)
- Files:
-
- branches/libffado-2.0/src/libutil/PosixMutex.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/src/libutil/PosixMutex.cpp
r1206 r1267 138 138 { 139 139 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "(%p) checking lock\n", this); 140 int res =pthread_mutex_trylock(&m_mutex);140 int res = pthread_mutex_trylock(&m_mutex); 141 141 if(res == 0) { 142 142 pthread_mutex_unlock(&m_mutex); 143 143 return false; 144 144 } else { 145 if(res != EBUSY) { 145 if (res == EDEADLK) { 146 // this means that the current thread already has the lock, 147 // iow it's locked. 148 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "(%p) lock taken by current thread\n", this); 149 } else if(res == EBUSY) { 150 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "(%p) lock taken\n", this); 151 } else { 146 152 debugError("Bogus error code: %d\n", res); 147 153 }