Ignore:
Timestamp:
2023-02-11T18:50:54Z (14 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
111b9b9
Parents:
11d2c983
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-05 15:30:26)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-11 18:50:54)
Message:

Reorganize mutex implementation

File:
1 edited

Legend:

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

    r11d2c983 r76e17d7c  
    5555}
    5656
    57 errno_t _semaphore_down_timeout(semaphore_t *sem, uint32_t usec, unsigned flags)
    58 {
    59         errno_t rc = waitq_sleep_timeout(&sem->wq, usec, flags, NULL);
    60         assert(rc == EOK || rc == ETIMEOUT || rc == EAGAIN);
    61         return rc;
    62 }
    63 
    6457errno_t semaphore_trydown(semaphore_t *sem)
    6558{
    66         return _semaphore_down_timeout(sem, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NON_BLOCKING);
     59        return semaphore_down_timeout(sem, 0);
    6760}
    6861
     
    7770errno_t semaphore_down_timeout(semaphore_t *sem, uint32_t usec)
    7871{
    79         return _semaphore_down_timeout(sem, usec, SYNCH_FLAGS_NON_BLOCKING);
     72        errno_t rc = waitq_sleep_timeout(&sem->wq, usec, SYNCH_FLAGS_NON_BLOCKING, NULL);
     73        assert(rc == EOK || rc == ETIMEOUT || rc == EAGAIN);
     74        return rc;
    8075}
    8176
Note: See TracChangeset for help on using the changeset viewer.