From ff2e6c647d166fa54769f3c300855ef7f8020668 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 2 Aug 2016 11:26:56 +0200 Subject: score: Fix and simplify thread wait locks There was a subtile race condition in _Thread_queue_Do_extract_locked(). It must first update the thread wait flags and then restore the default thread wait state. In the previous implementation this could lead under rare timing conditions to an ineffective _Thread_Wait_tranquilize() resulting to a corrupt system state. Update #2556. --- cpukit/score/src/threadinitialize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpukit/score/src/threadinitialize.c') diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index 209be9ebb1..b5fef590fc 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -186,7 +186,7 @@ bool _Thread_Initialize( &the_thread->Wait.Lock.Default, "Thread Wait Default Lock" ); - _Chain_Initialize_empty( &the_thread->Wait.Lock.Pending_requests ); + _Thread_queue_Gate_open( &the_thread->Wait.Lock.Tranquilizer ); _SMP_lock_Stats_initialize( &the_thread->Potpourri_stats, "Thread Potpourri" ); #endif -- cgit v1.2.3