Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/semaphore.h

    r597fa24 re88eb48  
    4545} semaphore_t;
    4646
    47 #define SEMAPHORE_INITIALIZER(name, count) (semaphore_t) { \
    48         .wq = WAITQ_INITIALIZER_WITH_COUNT((name).wq, count), \
    49 }
     47#define semaphore_down(s) \
     48        _semaphore_down_timeout((s), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE)
    5049
    51 #define SEMAPHORE_INITIALIZE(name, count) \
    52         semaphore_t name = SEMAPHORE_INITIALIZER(name, count)
     50#define semaphore_trydown(s) \
     51        _semaphore_down_timeout((s), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NON_BLOCKING)
     52
     53#define semaphore_down_timeout(s, usec) \
     54        _semaphore_down_timeout((s), (usec), SYNCH_FLAGS_NONE)
     55
     56#define semaphore_down_interruptable(s) \
     57        (_semaphore_down_timeout((s), SYNCH_NO_TIMEOUT, \
     58                SYNCH_FLAGS_INTERRUPTIBLE) != EINTR)
    5359
    5460extern void semaphore_initialize(semaphore_t *, int);
    55 extern errno_t semaphore_down_timeout(semaphore_t *, uint32_t);
    56 extern errno_t semaphore_trydown(semaphore_t *);
    57 extern void semaphore_down(semaphore_t *);
     61extern errno_t _semaphore_down_timeout(semaphore_t *, uint32_t, unsigned int);
    5862extern void semaphore_up(semaphore_t *);
     63extern int semaphore_count_get(semaphore_t *);
    5964
    6065#endif
Note: See TracChangeset for help on using the changeset viewer.