summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadqflush.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src/threadqflush.c')
-rw-r--r--cpukit/score/src/threadqflush.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/cpukit/score/src/threadqflush.c b/cpukit/score/src/threadqflush.c
index 8135e67b62..ef4d6b1f09 100644
--- a/cpukit/score/src/threadqflush.c
+++ b/cpukit/score/src/threadqflush.c
@@ -66,13 +66,15 @@ size_t _Thread_queue_Flush_critical(
Thread_queue_Context *queue_context
)
{
- size_t flushed;
- Chain_Control unblock;
- Chain_Node *node;
- Chain_Node *tail;
+ size_t flushed;
+ Chain_Control unblock;
+ Thread_Control *owner;
+ Chain_Node *node;
+ Chain_Node *tail;
flushed = 0;
_Chain_Initialize_empty( &unblock );
+ owner = queue->owner;
while ( true ) {
Thread_queue_Heads *heads;
@@ -131,6 +133,14 @@ size_t _Thread_queue_Flush_critical(
node = next;
} while ( node != tail );
+ if ( owner != NULL ) {
+ ISR_lock_Context lock_context;
+
+ _Thread_State_acquire( owner, &lock_context );
+ _Scheduler_Update_priority( owner );
+ _Thread_State_release( owner, &lock_context );
+ }
+
_Thread_Dispatch_enable( cpu_self );
} else {
_Thread_queue_Queue_release( queue, &queue_context->Lock_context.Lock_context );