From 85817254348c558ec99a5c0499f16839802165e5 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 5 Aug 2013 14:25:41 +0200 Subject: score: Add and use _Per_CPU_Acquire_all(). Add and use _Per_CPU_Release_all(). The context switch user extensions are invoked in _Thread_Dispatch(). This change is necessary to avoid the giant lock in _Thread_Dispatch(). --- cpukit/score/src/userextaddset.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cpukit/score/src/userextaddset.c') diff --git a/cpukit/score/src/userextaddset.c b/cpukit/score/src/userextaddset.c index d24dc4a8e9..270d93cf5f 100644 --- a/cpukit/score/src/userextaddset.c +++ b/cpukit/score/src/userextaddset.c @@ -20,6 +20,7 @@ #endif #include +#include void _User_extensions_Add_set( User_extensions_Control *the_extension @@ -32,11 +33,16 @@ void _User_extensions_Add_set( */ if ( the_extension->Callouts.thread_switch != NULL ) { + ISR_Level level; + the_extension->Switch.thread_switch = the_extension->Callouts.thread_switch; - _Chain_Append( + + _Per_CPU_Acquire_all( level ); + _Chain_Append_unprotected( &_User_extensions_Switches_list, &the_extension->Switch.Node ); + _Per_CPU_Release_all( level ); } } -- cgit v1.2.3