Age | Commit message (Collapse) | Author |
|
Making the unlock operation block allows tricky deadlocks to occur in
case a thread is interrupted right before announcing itself as the first
waiter in the queue.
Since locking is expected to block, the spinlock implementation is
reworked to move the hand-off performed by the unlock operation into
the lock operation.
As a side effect, the common case of a single waiter is also optimized.
|
|
Use standard errno codes. This change also adds strerror to string.h.
|
|
|
|
|
|
This reverts commit d18d0e85596f90e0bd597b33d58209d0b3973c95.
|
|
These new macros take care of disabling/restoring interrupts in the
appropriate order.
|
|
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.
|
|
|
|
Rework so that fast paths occupy the first indentation level, and use
the unlikely macro on the relevant conditions.
|
|
This new implementation, based on the MCS locks, provides rigorous
fairness and excellent scalability.
|
|
|
|
Using a single header for all types causing inclusion circular
dependencies isn't very elegant and doesn't scale.
|
|
This change was done using astyle, with a few manual editing here and
there.
|
|
These initializers are unnecessary, unused, and cumbersome to maintain.
|
|
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.
|
|
Not a necessary change, but done for consistency.
|
|
Using a macro makes panic display the function where the assertion actually
failed.
|
|
Make trylock functions behave as error-returning functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Let the users deal with interrupts themselves. It allows greater freedom
to modules that need to carefully change the machine state.
|
|
This module provides spin locks.
|