diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-29 15:32:51 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-30 07:57:33 +0200 |
commit | b6b25a9e68f2c34fe9cb5b69fc802b4b9f25d53b (patch) | |
tree | a7a2bf366f5635ade55c9afa5f445627ca7aa9d8 /cpukit/score/src/threadinitialize.c | |
parent | score: _CPU_SMP_Send_interrupt() documentation (diff) | |
download | rtems-b6b25a9e68f2c34fe9cb5b69fc802b4b9f25d53b.tar.bz2 |
score: Fix thread lock on SMP configurations
Diffstat (limited to 'cpukit/score/src/threadinitialize.c')
-rw-r--r-- | cpukit/score/src/threadinitialize.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index 10dbf02dfc..7237cfeb75 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -179,7 +179,11 @@ bool _Thread_Initialize( the_thread->Scheduler.control = scheduler; the_thread->Scheduler.own_node = the_thread->Scheduler.node; _Resource_Node_initialize( &the_thread->Resource_node ); - the_thread->Lock.current = &the_thread->Lock.Default; + _Atomic_Store_uintptr( + &the_thread->Lock.current.atomic, + (uintptr_t) &the_thread->Lock.Default, + ATOMIC_ORDER_RELAXED + ); _SMP_ticket_lock_Initialize( &the_thread->Lock.Default ); _SMP_lock_Stats_initialize( &the_thread->Lock.Stats, "Thread Lock" ); _SMP_lock_Stats_initialize( &the_thread->Potpourri_stats, "Thread Potpourri" ); |