From 258ad71e9626c16f30b40e06c321326636c976ff Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 25 Sep 2015 14:34:24 +0200 Subject: SMP: Fix and optimize thread dispatching According to the C11 and C++11 memory models only a read-modify-write operation guarantees that we read the last value written in modification order. Avoid the sequential consistent thread fence and instead use the inter-processor interrupt to set the thread dispatch necessary indicator. --- testsuites/smptests/smpthreadlife01/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'testsuites') diff --git a/testsuites/smptests/smpthreadlife01/init.c b/testsuites/smptests/smpthreadlife01/init.c index 12b6bd9f44..4597520141 100644 --- a/testsuites/smptests/smpthreadlife01/init.c +++ b/testsuites/smptests/smpthreadlife01/init.c @@ -201,7 +201,6 @@ static void delay_ipi_task(rtems_task_argument variant) ISR_Level level; _ISR_Disable_without_giant(level); - (void) level; /* (C) */ barrier(ctx, &ctx->worker_barrier_state); @@ -216,6 +215,8 @@ static void delay_ipi_task(rtems_task_argument variant) _Thread_Disable_dispatch(); } + _ISR_Enable_without_giant(level); + /* * We get deleted as a side effect of enabling the thread life protection or * later if we enable the thread dispatching. -- cgit v1.2.3