summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-19 11:02:02 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-05-20 08:54:27 +0200
commitc63e8bbeb9ec2fac31a88821112076c50321b292 (patch)
tree5f85bddf8e24a41b69221d8fdede8b44b10df114 /cpukit/score
parentscore: Add _Per_CPU_Add_job() (diff)
downloadrtems-c63e8bbeb9ec2fac31a88821112076c50321b292.tar.bz2
score: Modify _Per_CPU_Perform_jobs()
Process only the jobs initially registered on the processing list. This makes it possible to add jobs for the current processor in a job handler. These jobs are processed with the next SMP_MESSAGE_PERFORM_JOBS message. The lock is only acquired and released once.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/src/smpmulticastaction.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/cpukit/score/src/smpmulticastaction.c b/cpukit/score/src/smpmulticastaction.c
index 1207000e6a..b5d21a4b56 100644
--- a/cpukit/score/src/smpmulticastaction.c
+++ b/cpukit/score/src/smpmulticastaction.c
@@ -44,18 +44,20 @@ void _Per_CPU_Perform_jobs( Per_CPU_Control *cpu )
Per_CPU_Job *job;
_Per_CPU_Jobs_ISR_disable_and_acquire( cpu, &lock_context );
+ job = cpu->Jobs.head;
+ cpu->Jobs.head = NULL;
+ _Per_CPU_Jobs_release_and_ISR_enable( cpu, &lock_context );
- while ( ( job = cpu->Jobs.head ) != NULL ) {
+ while ( job != NULL ) {
const Per_CPU_Job_context *context;
-
- cpu->Jobs.head = job->next;
- _Per_CPU_Jobs_release_and_ISR_enable( cpu, &lock_context );
+ Per_CPU_Job *next;
context = job->context;
+ next = job->next;
( *context->handler )( context->arg );
_Atomic_Store_ulong( &job->done, PER_CPU_JOB_DONE, ATOMIC_ORDER_RELEASE );
- _Per_CPU_Jobs_ISR_disable_and_acquire( cpu, &lock_context );
+ job = next;
}
}