summaryrefslogtreecommitdiff
path: root/kern/condition.c
AgeCommit message (Collapse)Author
2018-07-30Rework assertive functionsRichard Braun
Instead of combining assertions and checking into single functions, rework those into pure checking functions usable with assert(). Those functions were introduced because of warnings about unused functions/variables caused by an earlier implementation of assert().
2018-07-10kern/sleepq: make disabling interrupts optionalRichard Braun
Commit d2a89f7f6e976d022527c2a5a1c75268aab8cd49 changed sleep queues to allow semaphores to be signalled from interrupt handlers, but this implied disabling interrupts for all synchronization objects, and most of them do not require interrupts to be disabled. The sleep queue interface is augmented with interrupt-related versions.
2018-01-30Fix condition variable broadcastingRichard Braun
The broadcast implementation is based on an invalid assumption, namely that the first mutex_unlock call following condition_wait would be invoked on the same mutex. Fixing this while guarding against the thundering herd effect requires augmenting mutexes with a pointer to the condition variable they may be associated with. Since the size of mutexes is currently more important than broadcast scalability, the implementation is simplified into one which suffers from the thundering herd effect.
2017-12-03Revert "Make assert have no side effects"Richard Braun
This reverts commit d18d0e85596f90e0bd597b33d58209d0b3973c95.
2017-09-02Make assert have no side effectsRichard Braun
This makes sure symbols referenced by assert uses may not be generated if unused. The recently introduced __unused macro is used to suppress compiler warnings resulting from this change.
2017-08-27kern/condition: implement timed waitsRichard Braun
2017-05-30Move assert.h to the include directoryRichard Braun
This turns assert.h into a standard header.
2017-03-17kern/sleepq: also disable interrupts during critical sectionsRichard Braun
2017-03-17kern/{condition,mutex}: include stdbool.hRichard Braun
2017-03-04kern/{condition,mutex}: reimplement on top of sleep queuesRichard Braun
2017-02-04Clean up compilationRichard Braun
Instead of mixing standard headers and internal redefinitions of standard types, completely rely on the compiler for what is guaranteed for a free standing environment. This results in the removal of kern/stddef.h and kern/stdint.h. The kern/types.h header is reintroduced for the different (and saner) purpose of defining types not specified in standard C, namely ssize_t for now.
2017-02-04kern/types: split into module-specific type headersRichard Braun
Using a single header for all types causing inclusion circular dependencies isn't very elegant and doesn't scale.
2016-12-09Force brackets around one-line conditional statementsRichard Braun
This change was done using astyle, with a few manual editing here and there.
2014-06-18kern/thread: add thread_joinRichard Braun
This change affects more files than it apparently would at first glance. This is because circular dependencies can easily be created between the thread, mutex, condition and spinlock modules. As a result, some of the types of these modules are now defined in kern/types.h.
2014-01-03Update calls to atomic operationsRichard Braun
Make spin locks and mutexes encode their state on an int rather than a long.
2013-04-14kern/condition: make condition_init an inline functionRichard Braun
2013-04-14kern/{condition,mutex}: refactor common codeRichard Braun
The condition module intrusively uses mutexes. Augment the interface of the mutex module so that mutexes and conditions share common code. As a side effect, the implementation should have gained in clarity.
2013-04-14kern/condition: new moduleRichard Braun