Enhance spin_adaptive() to yield after several iterations.

This avoids worst case behavior if e.g. another thread is preempted
while owning the resource the spinning thread is waiting for.
This commit is contained in:
Jason Evans
2017-02-08 10:30:44 -08:00
parent 5f11830754
commit de8a68e853
3 changed files with 28 additions and 6 deletions

View File

@@ -189,6 +189,7 @@ TESTS_UNIT := \
$(srcroot)test/unit/size_classes.c \
$(srcroot)test/unit/slab.c \
$(srcroot)test/unit/smoothstep.c \
$(srcroot)test/unit/spin.c \
$(srcroot)test/unit/stats.c \
$(srcroot)test/unit/stats_print.c \
$(srcroot)test/unit/ticker.c \