Changes in kernel/generic/src/synch/mutex.c [2e4e706:a3900cc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/mutex.c
r2e4e706 ra3900cc 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(). 67 * 66 * @return See comment for waitq_sleep_timeout(). 68 67 */ 69 68 int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags) … … 71 70 int rc; 72 71 73 if ( (mtx->type == MUTEX_PASSIVE) && (THREAD)) {72 if (mtx->type == MUTEX_PASSIVE && THREAD) { 74 73 rc = _semaphore_down_timeout(&mtx->sem, usec, flags); 75 74 } else { 76 ASSERT( (mtx->type == MUTEX_ACTIVE) || (!THREAD));75 ASSERT(mtx->type == MUTEX_ACTIVE || !THREAD); 77 76 ASSERT(usec == SYNCH_NO_TIMEOUT); 78 77 ASSERT(!(flags & SYNCH_FLAGS_INTERRUPTIBLE)); 79 80 78 do { 81 79 rc = semaphore_trydown(&mtx->sem); … … 89 87 /** Release mutex. 90 88 * 91 * @param mtx 89 * @param mtx Mutex. 92 90 */ 93 91 void mutex_unlock(mutex_t *mtx)
Note:
See TracChangeset
for help on using the changeset viewer.