Changes in kernel/generic/src/synch/mutex.c [b7fd2a0:15d9fe6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/mutex.c
rb7fd2a0 r15d9fe6 37 37 38 38 #include <assert.h> 39 #include <errno.h>40 39 #include <synch/mutex.h> 41 40 #include <synch/semaphore.h> … … 85 84 * 86 85 */ 87 errno_t _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, unsigned int flags)86 int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, unsigned int flags) 88 87 { 89 errno_t rc;88 int rc; 90 89 91 90 if (mtx->type == MUTEX_PASSIVE && THREAD) { … … 96 95 if (mtx->owner == THREAD) { 97 96 mtx->nesting++; 98 return E OK;97 return ESYNCH_OK_ATOMIC; 99 98 } else { 100 99 rc = _semaphore_down_timeout(&mtx->sem, usec, flags); 101 if ( rc == EOK) {100 if (SYNCH_OK(rc)) { 102 101 mtx->owner = THREAD; 103 102 mtx->nesting = 1; … … 120 119 } 121 120 rc = semaphore_trydown(&mtx->sem); 122 } while (rc != EOK && !(flags & SYNCH_FLAGS_NON_BLOCKING)); 121 } while (SYNCH_FAILED(rc) && 122 !(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.