Changes in kernel/generic/src/synch/mutex.c [2e4e706:08a19ba] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/mutex.c
r2e4e706 r08a19ba 33 33 /** 34 34 * @file 35 * @brief 35 * @brief Mutexes. 36 36 */ 37 37 38 38 #include <synch/mutex.h> 39 39 #include <synch/semaphore.h> 40 40 #include <synch/synch.h> 41 41 #include <debug.h> 42 #include <arch.h>43 42 44 43 /** Initialize mutex. 45 44 * 46 * @param mtx 47 * @param type 45 * @param mtx Mutex. 46 * @param type Type of the mutex. 48 47 */ 49 48 void mutex_initialize(mutex_t *mtx, mutex_type_t type) … … 57 56 * Timeout mode and non-blocking mode can be requested. 58 57 * 59 * @param mtx 60 * @param usec 61 * @param flags 58 * @param mtx Mutex. 59 * @param usec Timeout in microseconds. 60 * @param flags Specify mode of operation. 62 61 * 63 62 * For exact description of possible combinations of 64 63 * usec and flags, see comment for waitq_sleep_timeout(). 65 64 * 66 * @return See comment for waitq_sleep_timeout(). 67 * 65 * @return See comment for waitq_sleep_timeout(). 68 66 */ 69 67 int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags) … … 71 69 int rc; 72 70 73 if ( (mtx->type == MUTEX_PASSIVE) && (THREAD)) {71 if (mtx->type == MUTEX_PASSIVE) { 74 72 rc = _semaphore_down_timeout(&mtx->sem, usec, flags); 75 73 } else { 76 ASSERT( (mtx->type == MUTEX_ACTIVE) || (!THREAD));74 ASSERT(mtx->type == MUTEX_ACTIVE); 77 75 ASSERT(usec == SYNCH_NO_TIMEOUT); 78 76 ASSERT(!(flags & SYNCH_FLAGS_INTERRUPTIBLE)); 79 80 77 do { 81 78 rc = semaphore_trydown(&mtx->sem); … … 89 86 /** Release mutex. 90 87 * 91 * @param mtx 88 * @param mtx Mutex. 92 89 */ 93 90 void mutex_unlock(mutex_t *mtx)
Note:
See TracChangeset
for help on using the changeset viewer.