summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-02-01 21:54:40 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-02-01 21:54:40 +0000
commitf00a0522a48cbd903e830c4b24e1c9407ca1f6df (patch)
treece8b3f6764d4f6ef6c4c5c80354b45d2a8a17479 /cpukit
parentinvalid use of tcb field resource count (diff)
downloadrtems-f00a0522a48cbd903e830c4b24e1c9407ca1f6df.tar.bz2
synchronization state bugs address
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/score/src/threadq.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c
index f388959268..dc52efa954 100644
--- a/cpukit/score/src/threadq.c
+++ b/cpukit/score/src/threadq.c
@@ -366,9 +366,10 @@ void _Thread_queue_Enqueue_fifo (
_ISR_Disable( level );
+ the_thread_queue->sync = FALSE;
+
switch ( the_thread_queue->sync_state ) {
case THREAD_QUEUE_NOTHING_HAPPENED:
- the_thread_queue->sync = FALSE;
_Chain_Append_unprotected(
&the_thread_queue->Queues.Fifo,
&the_thread->Object.Node
@@ -448,7 +449,8 @@ Thread_Control *_Thread_queue_Dequeue_fifo(
_Thread_MP_Free_proxy( the_thread );
return the_thread;
- } else if ( the_thread_queue->sync ) {
+ } else if ( the_thread_queue->sync &&
+ the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED ) {
the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
_ISR_Enable( level );
return _Thread_Executing;
@@ -602,11 +604,12 @@ restart_forward_search:
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
- if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
- goto syncronize;
the_thread_queue->sync = FALSE;
+ if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
+ goto syncronize;
+
if ( priority == search_priority )
goto equal_priority;
@@ -646,11 +649,12 @@ restart_reverse_search:
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
- if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
- goto syncronize;
the_thread_queue->sync = FALSE;
+ if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
+ goto syncronize;
+
if ( priority == search_priority )
goto equal_priority;
@@ -755,7 +759,8 @@ Thread_Control *_Thread_queue_Dequeue_priority(
}
}
- if ( the_thread_queue->sync ) {
+ if ( the_thread_queue->sync &&
+ the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED ) {
the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
_ISR_Enable( level );
return _Thread_Executing;