diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-07-25 16:35:37 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-07-27 10:55:30 +0200 |
commit | 1fcac5adc5ed38fb88ce4c6d24b2ca2e27e3cd10 (patch) | |
tree | 7d2fed265befa680902ff146acb3305a360f9116 /cpukit/score/src/threadinitialize.c | |
parent | score: Priority inherit thread queue operations (diff) | |
download | rtems-1fcac5adc5ed38fb88ce4c6d24b2ca2e27e3cd10.tar.bz2 |
score: Turn thread lock into thread wait lock
The _Thread_Lock_acquire() function had a potentially infinite run-time
due to the lack of fairness at atomic operations level.
Update #2412.
Update #2556.
Update #2765.
Diffstat (limited to 'cpukit/score/src/threadinitialize.c')
-rw-r--r-- | cpukit/score/src/threadinitialize.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index 940537f135..209be9ebb1 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -182,13 +182,11 @@ bool _Thread_Initialize( the_thread->Scheduler.control = scheduler; the_thread->Scheduler.own_node = scheduler_node; _Resource_Node_initialize( &the_thread->Resource_node ); - _Atomic_Store_uintptr( - &the_thread->Lock.current.atomic, - (uintptr_t) &the_thread->Lock.Default, - ATOMIC_ORDER_RELAXED + _ISR_lock_Initialize( + &the_thread->Wait.Lock.Default, + "Thread Wait Default Lock" ); - _SMP_ticket_lock_Initialize( &the_thread->Lock.Default ); - _SMP_lock_Stats_initialize( &the_thread->Lock.Stats, "Thread Lock" ); + _Chain_Initialize_empty( &the_thread->Wait.Lock.Pending_requests ); _SMP_lock_Stats_initialize( &the_thread->Potpourri_stats, "Thread Potpourri" ); #endif |