Changes in kernel/generic/src/synch/mutex.c [15d9fe6:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/mutex.c
r15d9fe6 rb7fd2a0 37 37 38 38 #include <assert.h> 39 #include <errno.h> 39 40 #include <synch/mutex.h> 40 41 #include <synch/semaphore.h> … … 84 85 * 85 86 */ 86 int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, unsigned int flags)87 errno_t _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, unsigned int flags) 87 88 { 88 int rc;89 errno_t rc; 89 90 90 91 if (mtx->type == MUTEX_PASSIVE && THREAD) { … … 95 96 if (mtx->owner == THREAD) { 96 97 mtx->nesting++; 97 return E SYNCH_OK_ATOMIC;98 return EOK; 98 99 } else { 99 100 rc = _semaphore_down_timeout(&mtx->sem, usec, flags); 100 if ( SYNCH_OK(rc)) {101 if (rc == EOK) { 101 102 mtx->owner = THREAD; 102 103 mtx->nesting = 1; … … 119 120 } 120 121 rc = semaphore_trydown(&mtx->sem); 121 } while (SYNCH_FAILED(rc) && 122 !(flags & SYNCH_FLAGS_NON_BLOCKING)); 122 } while (rc != EOK && !(flags & SYNCH_FLAGS_NON_BLOCKING)); 123 123 if (deadlock_reported) 124 124 printf("cpu%u: not deadlocked\n", CPU->id);
Note:
See TracChangeset
for help on using the changeset viewer.