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