Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/mutex.c

    r2e4e706 r08a19ba  
    3333/**
    3434 * @file
    35  * @brief Mutexes.
     35 * @brief       Mutexes.
    3636 */
    37 
     37 
    3838#include <synch/mutex.h>
    3939#include <synch/semaphore.h>
    4040#include <synch/synch.h>
    4141#include <debug.h>
    42 #include <arch.h>
    4342
    4443/** Initialize mutex.
    4544 *
    46  * @param mtx  Mutex.
    47  * @param type Type of the mutex.
     45 * @param mtx           Mutex.
     46 * @param type          Type of the mutex.
    4847 */
    4948void mutex_initialize(mutex_t *mtx, mutex_type_t type)
     
    5756 * Timeout mode and non-blocking mode can be requested.
    5857 *
    59  * @param mtx   Mutex.
    60  * @param usec  Timeout in microseconds.
    61  * @param flags Specify mode of operation.
     58 * @param mtx           Mutex.
     59 * @param usec          Timeout in microseconds.
     60 * @param flags         Specify mode of operation.
    6261 *
    6362 * For exact description of possible combinations of
    6463 * usec and flags, see comment for waitq_sleep_timeout().
    6564 *
    66  * @return See comment for waitq_sleep_timeout().
    67  *
     65 * @return              See comment for waitq_sleep_timeout().
    6866 */
    6967int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags)
     
    7169        int rc;
    7270
    73         if ((mtx->type == MUTEX_PASSIVE) && (THREAD)) {
     71        if (mtx->type == MUTEX_PASSIVE) {
    7472                rc = _semaphore_down_timeout(&mtx->sem, usec, flags);
    7573        } else {
    76                 ASSERT((mtx->type == MUTEX_ACTIVE) || (!THREAD));
     74                ASSERT(mtx->type == MUTEX_ACTIVE);
    7775                ASSERT(usec == SYNCH_NO_TIMEOUT);
    7876                ASSERT(!(flags & SYNCH_FLAGS_INTERRUPTIBLE));
    79                
    8077                do {
    8178                        rc = semaphore_trydown(&mtx->sem);
     
    8986/** Release mutex.
    9087 *
    91  * @param mtx Mutex.
     88 * @param mtx           Mutex.
    9289 */
    9390void mutex_unlock(mutex_t *mtx)
Note: See TracChangeset for help on using the changeset viewer.