summaryrefslogtreecommitdiff
path: root/kern/semaphore_i.h
AgeCommit message (Collapse)Author
2019-01-10kern/semaphore: reworkRichard Braun
The previous implementation, which uses a combination of fast and slow paths around accessing an atomic integer, suffers from a bug triggered when two or more posts are performed back-to-back, without a waiter decrementing the semaphore value in between. The first post would be the only one signalling a waiter. In addition, having a fast path that expects the absence of waiters probably doesn't make sense, as semaphores are expected to be used for signalling threads. As a result, it was decided to remove the fast path altogether, and protect the semaphore value with sleep queues. Finally, as part of the rework, semaphores now have a user-defined maximum value, in order to make the implementation of, e.g. wrappers for binary semaphores, convenient. Thanks to Simon Venken for reporting the bug.
2018-04-19kern/atomic: remove shortcutsRichard Braun
These shortcuts just don't bring enough value.
2018-02-24Don't use reserved identifiersRichard Braun
2017-09-07kern/semaphore: add missing atomic accessRichard Braun
2017-08-27kern/semaphore: implement timed waitsRichard Braun
2017-05-30Move assert.h to the include directoryRichard Braun
This turns assert.h into a standard header.
2017-05-09Replace sequential consistency with more efficient ordersAgustina Arzille
2017-04-04Use the new atomic operations interfaceAgustina Arzille
Stick to a sequentially consistent model for most atomic operations as it matches the semantics of the existing code. Each call site will have to be reevaluated in order to switch to more relaxed accesses where possible.
2017-03-17kern/semaphore: new moduleRichard Braun