Age | Commit message (Collapse) | Author |
|
These shortcuts just don't bring enough value.
|
|
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 turns assert.h into a standard header.
|
|
|
|
Rework so that fast paths occupy the first indentation level, and use
the unlikely macro on the relevant conditions.
|
|
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.
|
|
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.
|
|
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.
|
|
Make spin locks and mutexes encode their state on an int rather than
a long.
|
|
|
|
Make trylock functions behave as error-returning functions.
|
|
|