Ignore:
File:
1 edited

Legend:

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

    r897fd8f1 r15d9fe6  
    3737
    3838#include <assert.h>
    39 #include <errno.h>
    4039#include <synch/mutex.h>
    4140#include <synch/semaphore.h>
     
    9695                if (mtx->owner == THREAD) {
    9796                        mtx->nesting++;
    98                         return EOK;
     97                        return ESYNCH_OK_ATOMIC;
    9998                } else {
    10099                        rc = _semaphore_down_timeout(&mtx->sem, usec, flags);
    101                         if (rc == EOK) {
     100                        if (SYNCH_OK(rc)) {
    102101                                mtx->owner = THREAD;
    103102                                mtx->nesting = 1;
     
    120119                        }
    121120                        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));
    123123                if (deadlock_reported)
    124124                        printf("cpu%u: not deadlocked\n", CPU->id);
Note: See TracChangeset for help on using the changeset viewer.