summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-22 21:29:21 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-23 08:55:43 +0200
commit9f10911d2b653859f7199eaed5a85a24803711dc (patch)
tree3dcee8b9f5ad179e8a82b852c7ad5837d30abbb0
parentscore: Fix priority message queue insert (diff)
downloadrtems-9f10911d2b653859f7199eaed5a85a24803711dc.tar.bz2
score: Delete Thread_queue_Control::state
Use a parameter for _Thread_queue_Enqueue() instead to reduce memory usage.
-rw-r--r--cpukit/libfs/src/pipe/fifo.c25
-rw-r--r--cpukit/posix/src/condinit.c1
-rw-r--r--cpukit/posix/src/condwaitsupp.c9
-rw-r--r--cpukit/posix/src/psignal.c2
-rw-r--r--cpukit/posix/src/pthread.c1
-rw-r--r--cpukit/posix/src/pthreadjoin.c2
-rw-r--r--cpukit/posix/src/sigtimedwait.c7
-rw-r--r--cpukit/rtems/src/regioncreate.c2
-rw-r--r--cpukit/rtems/src/regiongetsegment.c2
-rw-r--r--cpukit/score/include/rtems/score/coresemimpl.h8
-rw-r--r--cpukit/score/include/rtems/score/threadq.h4
-rw-r--r--cpukit/score/include/rtems/score/threadqimpl.h4
-rw-r--r--cpukit/score/src/corebarrier.c2
-rw-r--r--cpukit/score/src/corebarrierwait.c8
-rw-r--r--cpukit/score/src/coremsg.c2
-rw-r--r--cpukit/score/src/coremsgseize.c8
-rw-r--r--cpukit/score/src/coremsgsubmit.c2
-rw-r--r--cpukit/score/src/coremutex.c1
-rw-r--r--cpukit/score/src/coremutexseize.c8
-rw-r--r--cpukit/score/src/corerwlock.c2
-rw-r--r--cpukit/score/src/corerwlockobtainread.c2
-rw-r--r--cpukit/score/src/corerwlockobtainwrite.c2
-rw-r--r--cpukit/score/src/coresem.c2
-rw-r--r--cpukit/score/src/coresemseize.c7
-rw-r--r--cpukit/score/src/mpci.c5
-rw-r--r--cpukit/score/src/threadq.c2
-rw-r--r--cpukit/score/src/threadqenqueue.c5
-rw-r--r--testsuites/sptests/spthreadq01/init.c2
28 files changed, 65 insertions, 62 deletions
diff --git a/cpukit/libfs/src/pipe/fifo.c b/cpukit/libfs/src/pipe/fifo.c
index 91d95dc946..76550ddd06 100644
--- a/cpukit/libfs/src/pipe/fifo.c
+++ b/cpukit/libfs/src/pipe/fifo.c
@@ -61,27 +61,6 @@ static rtems_id pipe_semaphore = RTEMS_ID_NONE;
#define PIPE_WAKEUPWRITERS(_pipe) \
do {uint32_t n; rtems_barrier_release(_pipe->writeBarrier, &n); } while(0)
-
-#ifdef RTEMS_POSIX_API
-#include <rtems/rtems/barrier.h>
-#include <rtems/score/thread.h>
-
-/* Set barriers to be interruptible by signals. */
-static void pipe_interruptible(pipe_control_t *pipe)
-{
- Objects_Locations location;
- Barrier_Control *the_barrier;
-
- the_barrier = _Barrier_Get(pipe->readBarrier, &location);
- the_barrier->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL;
- _Objects_Put( &the_barrier->Object );
-
- the_barrier = _Barrier_Get(pipe->writeBarrier, &location);
- the_barrier->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL;
- _Objects_Put( &the_barrier->Object );
-}
-#endif
-
/*
* Alloc pipe control structure, buffer, and resources.
* Called with pipe_semaphore held.
@@ -122,10 +101,6 @@ static int pipe_alloc(
RTEMS_NO_PRIORITY, &pipe->Semaphore) != RTEMS_SUCCESSFUL)
goto err_sem;
-#ifdef RTEMS_POSIX_API
- pipe_interruptible(pipe);
-#endif
-
*pipep = pipe;
if (c ++ == 'z')
c = 'a';
diff --git a/cpukit/posix/src/condinit.c b/cpukit/posix/src/condinit.c
index 81575f2b17..c1c14b8bf9 100644
--- a/cpukit/posix/src/condinit.c
+++ b/cpukit/posix/src/condinit.c
@@ -65,7 +65,6 @@ int pthread_cond_init(
_Thread_queue_Initialize(
&the_cond->Wait_queue,
THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_CONDITION_VARIABLE | STATES_INTERRUPTIBLE_BY_SIGNAL,
ETIMEDOUT
);
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c
index 2a0b57f405..1abdc426fc 100644
--- a/cpukit/posix/src/condwaitsupp.c
+++ b/cpukit/posix/src/condwaitsupp.c
@@ -23,6 +23,7 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
+#include <rtems/score/statesimpl.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/time.h>
#include <rtems/posix/muteximpl.h>
@@ -79,7 +80,13 @@ int _POSIX_Condition_variables_Wait_support(
executing->Wait.queue = &the_cond->Wait_queue;
executing->Wait.id = *cond;
- _Thread_queue_Enqueue( &the_cond->Wait_queue, executing, timeout );
+ _Thread_queue_Enqueue(
+ &the_cond->Wait_queue,
+ executing,
+ STATES_WAITING_FOR_CONDITION_VARIABLE
+ | STATES_INTERRUPTIBLE_BY_SIGNAL,
+ timeout
+ );
_Objects_Put( &the_cond->Object );
diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c
index 0e2a018041..eec4d95fb5 100644
--- a/cpukit/posix/src/psignal.c
+++ b/cpukit/posix/src/psignal.c
@@ -24,7 +24,6 @@
#include <stdlib.h>
#include <rtems/score/isrlevel.h>
-#include <rtems/score/statesimpl.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/threadqimpl.h>
#include <rtems/score/watchdogimpl.h>
@@ -194,7 +193,6 @@ void _POSIX_signals_Manager_Initialization(void)
_Thread_queue_Initialize(
&_POSIX_signals_Wait_queue,
THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL,
EAGAIN
);
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 6b1e55549b..4d28de536f 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -238,7 +238,6 @@ static bool _POSIX_Threads_Create_extension(
_Thread_queue_Initialize(
&api->Join_List,
THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_INTERRUPTIBLE_BY_SIGNAL,
0
);
diff --git a/cpukit/posix/src/pthreadjoin.c b/cpukit/posix/src/pthreadjoin.c
index 136eea6eed..99cc4d3be8 100644
--- a/cpukit/posix/src/pthreadjoin.c
+++ b/cpukit/posix/src/pthreadjoin.c
@@ -26,6 +26,7 @@
#include <rtems/posix/pthreadimpl.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/threadqimpl.h>
+#include <rtems/score/statesimpl.h>
int pthread_join(
pthread_t thread,
@@ -70,6 +71,7 @@ on_EINTR:
_Thread_queue_Enqueue(
&api->Join_List,
executing,
+ STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_INTERRUPTIBLE_BY_SIGNAL,
WATCHDOG_NO_TIMEOUT
);
}
diff --git a/cpukit/posix/src/sigtimedwait.c b/cpukit/posix/src/sigtimedwait.c
index 4c456dd78a..8d86ba72a9 100644
--- a/cpukit/posix/src/sigtimedwait.c
+++ b/cpukit/posix/src/sigtimedwait.c
@@ -158,7 +158,12 @@ int sigtimedwait(
executing->Wait.return_argument = the_info;
_Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
_POSIX_signals_Release( &lock_context );
- _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, executing, interval );
+ _Thread_queue_Enqueue(
+ &_POSIX_signals_Wait_queue,
+ executing,
+ STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL,
+ interval
+ );
_Thread_Enable_dispatch();
/*
diff --git a/cpukit/rtems/src/regioncreate.c b/cpukit/rtems/src/regioncreate.c
index 6c623c8250..0daf644ce3 100644
--- a/cpukit/rtems/src/regioncreate.c
+++ b/cpukit/rtems/src/regioncreate.c
@@ -22,7 +22,6 @@
#include <rtems/rtems/attrimpl.h>
#include <rtems/rtems/support.h>
#include <rtems/score/apimutex.h>
-#include <rtems/score/statesimpl.h>
#include <rtems/score/threadqimpl.h>
/*
@@ -94,7 +93,6 @@ rtems_status_code rtems_region_create(
&the_region->Wait_queue,
_Attributes_Is_priority( attribute_set ) ?
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_SEGMENT,
RTEMS_TIMEOUT
);
diff --git a/cpukit/rtems/src/regiongetsegment.c b/cpukit/rtems/src/regiongetsegment.c
index 4bd244551a..1a52bc1d59 100644
--- a/cpukit/rtems/src/regiongetsegment.c
+++ b/cpukit/rtems/src/regiongetsegment.c
@@ -22,6 +22,7 @@
#include <rtems/rtems/optionsimpl.h>
#include <rtems/score/apimutex.h>
#include <rtems/score/threadqimpl.h>
+#include <rtems/score/statesimpl.h>
rtems_status_code rtems_region_get_segment(
rtems_id id,
@@ -88,6 +89,7 @@ rtems_status_code rtems_region_get_segment(
_Thread_queue_Enqueue(
&the_region->Wait_queue,
executing,
+ STATES_WAITING_FOR_SEGMENT,
timeout
);
diff --git a/cpukit/score/include/rtems/score/coresemimpl.h b/cpukit/score/include/rtems/score/coresemimpl.h
index 99303d7aa3..6a3a212f34 100644
--- a/cpukit/score/include/rtems/score/coresemimpl.h
+++ b/cpukit/score/include/rtems/score/coresemimpl.h
@@ -22,6 +22,7 @@
#include <rtems/score/coresem.h>
#include <rtems/score/threaddispatch.h>
#include <rtems/score/threadqimpl.h>
+#include <rtems/score/statesimpl.h>
#ifdef __cplusplus
extern "C" {
@@ -238,7 +239,12 @@ RTEMS_INLINE_ROUTINE void _CORE_semaphore_Seize_isr_disable(
executing->Wait.id = id;
_ISR_lock_ISR_enable( lock_context );
- _Thread_queue_Enqueue( &the_semaphore->Wait_queue, executing, timeout );
+ _Thread_queue_Enqueue(
+ &the_semaphore->Wait_queue,
+ executing,
+ STATES_WAITING_FOR_SEMAPHORE,
+ timeout
+ );
_Thread_Enable_dispatch();
}
diff --git a/cpukit/score/include/rtems/score/threadq.h b/cpukit/score/include/rtems/score/threadq.h
index 6dcdf41aaa..00b9221356 100644
--- a/cpukit/score/include/rtems/score/threadq.h
+++ b/cpukit/score/include/rtems/score/threadq.h
@@ -66,10 +66,6 @@ typedef struct {
Thread_blocking_operation_States sync_state;
/** This field indicates the thread queue's blocking discipline. */
Thread_queue_Disciplines discipline;
- /** This indicates the blocking state for threads waiting on this
- * thread queue.
- */
- States_Control state;
/** This is the status value returned to threads which timeout while
* waiting on this thread queue.
*/
diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h
index 57bdf054b9..c1bd902f33 100644
--- a/cpukit/score/include/rtems/score/threadqimpl.h
+++ b/cpukit/score/include/rtems/score/threadqimpl.h
@@ -71,6 +71,7 @@ Thread_Control *_Thread_queue_Dequeue(
*
* @param[in] the_thread_queue pointer to threadq
* @param[in] the_thread the thread to enqueue
+ * @param[in] state is the new state of the thread
* @param[in] timeout interval to wait
*
* - INTERRUPT LATENCY:
@@ -79,6 +80,7 @@ Thread_Control *_Thread_queue_Dequeue(
void _Thread_queue_Enqueue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
+ States_Control state,
Watchdog_Interval timeout
);
@@ -170,13 +172,11 @@ void _Thread_queue_Flush(
*
* @param[in] the_thread_queue is the pointer to a threadq header
* @param[in] the_discipline is the queueing discipline
- * @param[in] state is the state of waiting threads
* @param[in] timeout_status is the return on a timeout
*/
void _Thread_queue_Initialize(
Thread_queue_Control *the_thread_queue,
Thread_queue_Disciplines the_discipline,
- States_Control state,
uint32_t timeout_status
);
diff --git a/cpukit/score/src/corebarrier.c b/cpukit/score/src/corebarrier.c
index fe2a2e9aad..2035961b92 100644
--- a/cpukit/score/src/corebarrier.c
+++ b/cpukit/score/src/corebarrier.c
@@ -19,7 +19,6 @@
#endif
#include <rtems/score/corebarrierimpl.h>
-#include <rtems/score/statesimpl.h>
#include <rtems/score/threadqimpl.h>
void _CORE_barrier_Initialize(
@@ -34,7 +33,6 @@ void _CORE_barrier_Initialize(
_Thread_queue_Initialize(
&the_barrier->Wait_queue,
THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_BARRIER,
CORE_BARRIER_TIMEOUT
);
}
diff --git a/cpukit/score/src/corebarrierwait.c b/cpukit/score/src/corebarrierwait.c
index 3fedb31363..6267ae67c0 100644
--- a/cpukit/score/src/corebarrierwait.c
+++ b/cpukit/score/src/corebarrierwait.c
@@ -20,6 +20,7 @@
#include <rtems/score/corebarrierimpl.h>
#include <rtems/score/isrlevel.h>
+#include <rtems/score/statesimpl.h>
#include <rtems/score/threadqimpl.h>
void _CORE_barrier_Wait(
@@ -51,5 +52,10 @@ void _CORE_barrier_Wait(
executing->Wait.id = id;
_ISR_Enable( level );
- _Thread_queue_Enqueue( &the_barrier->Wait_queue, executing, timeout );
+ _Thread_queue_Enqueue(
+ &the_barrier->Wait_queue,
+ executing,
+ STATES_WAITING_FOR_BARRIER,
+ timeout
+ );
}
diff --git a/cpukit/score/src/coremsg.c b/cpukit/score/src/coremsg.c
index fc1ca451b1..0790221eb9 100644
--- a/cpukit/score/src/coremsg.c
+++ b/cpukit/score/src/coremsg.c
@@ -19,7 +19,6 @@
#endif
#include <rtems/score/coremsgimpl.h>
-#include <rtems/score/statesimpl.h>
#include <rtems/score/wkspace.h>
/*
@@ -113,7 +112,6 @@ bool _CORE_message_queue_Initialize(
&the_message_queue->Wait_queue,
_CORE_message_queue_Is_priority( the_message_queue_attributes ) ?
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_MESSAGE,
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
);
diff --git a/cpukit/score/src/coremsgseize.c b/cpukit/score/src/coremsgseize.c
index e4a4270013..db8d558ca6 100644
--- a/cpukit/score/src/coremsgseize.c
+++ b/cpukit/score/src/coremsgseize.c
@@ -23,6 +23,7 @@
#include <rtems/score/isr.h>
#include <rtems/score/coremsgimpl.h>
#include <rtems/score/thread.h>
+#include <rtems/score/statesimpl.h>
#include <rtems/score/wkspace.h>
void _CORE_message_queue_Seize(
@@ -121,5 +122,10 @@ void _CORE_message_queue_Seize(
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
- _Thread_queue_Enqueue( &the_message_queue->Wait_queue, executing, timeout );
+ _Thread_queue_Enqueue(
+ &the_message_queue->Wait_queue,
+ executing,
+ STATES_WAITING_FOR_MESSAGE,
+ timeout
+ );
}
diff --git a/cpukit/score/src/coremsgsubmit.c b/cpukit/score/src/coremsgsubmit.c
index 4ee41b83e2..4437856b17 100644
--- a/cpukit/score/src/coremsgsubmit.c
+++ b/cpukit/score/src/coremsgsubmit.c
@@ -22,6 +22,7 @@
#include <rtems/score/coremsgimpl.h>
#include <rtems/score/objectimpl.h>
#include <rtems/score/isr.h>
+#include <rtems/score/statesimpl.h>
#include <rtems/score/wkspace.h>
CORE_message_queue_Status _CORE_message_queue_Submit(
@@ -133,6 +134,7 @@ CORE_message_queue_Status _CORE_message_queue_Submit(
_Thread_queue_Enqueue(
&the_message_queue->Wait_queue,
executing,
+ STATES_WAITING_FOR_MESSAGE,
timeout
);
}
diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c
index 949aa703ba..b5e8a5ed4b 100644
--- a/cpukit/score/src/coremutex.c
+++ b/cpukit/score/src/coremutex.c
@@ -84,7 +84,6 @@ CORE_mutex_Status _CORE_mutex_Initialize(
&the_mutex->Wait_queue,
_CORE_mutex_Is_fifo( the_mutex_attributes ) ?
THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY,
- STATES_WAITING_FOR_MUTEX,
CORE_MUTEX_TIMEOUT
);
diff --git a/cpukit/score/src/coremutexseize.c b/cpukit/score/src/coremutexseize.c
index 2f9c8da523..d49b566471 100644
--- a/cpukit/score/src/coremutexseize.c
+++ b/cpukit/score/src/coremutexseize.c
@@ -22,6 +22,7 @@
#include <rtems/score/isr.h>
#include <rtems/score/coremuteximpl.h>
#include <rtems/score/schedulerimpl.h>
+#include <rtems/score/statesimpl.h>
#include <rtems/score/thread.h>
#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__)
@@ -63,7 +64,12 @@ void _CORE_mutex_Seize_interrupt_blocking(
);
}
- _Thread_queue_Enqueue( &the_mutex->Wait_queue, executing, timeout );
+ _Thread_queue_Enqueue(
+ &the_mutex->Wait_queue,
+ executing,
+ STATES_WAITING_FOR_MUTEX,
+ timeout
+ );
_Thread_Enable_dispatch();
}
diff --git a/cpukit/score/src/corerwlock.c b/cpukit/score/src/corerwlock.c
index 0c66f52238..0d47db4b23 100644
--- a/cpukit/score/src/corerwlock.c
+++ b/cpukit/score/src/corerwlock.c
@@ -19,7 +19,6 @@
#endif
#include <rtems/score/corerwlockimpl.h>
-#include <rtems/score/statesimpl.h>
#include <rtems/score/threadqimpl.h>
void _CORE_RWLock_Initialize(
@@ -38,7 +37,6 @@ void _CORE_RWLock_Initialize(
_Thread_queue_Initialize(
&the_rwlock->Wait_queue,
THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_RWLOCK,
CORE_RWLOCK_TIMEOUT
);
}
diff --git a/cpukit/score/src/corerwlockobtainread.c b/cpukit/score/src/corerwlockobtainread.c
index f3851b4fd3..203680f6dc 100644
--- a/cpukit/score/src/corerwlockobtainread.c
+++ b/cpukit/score/src/corerwlockobtainread.c
@@ -20,6 +20,7 @@
#include <rtems/score/corerwlockimpl.h>
#include <rtems/score/threadqimpl.h>
+#include <rtems/score/statesimpl.h>
#include <rtems/score/watchdog.h>
void _CORE_RWLock_Obtain_for_reading(
@@ -87,6 +88,7 @@ void _CORE_RWLock_Obtain_for_reading(
_Thread_queue_Enqueue(
&the_rwlock->Wait_queue,
executing,
+ STATES_WAITING_FOR_RWLOCK,
timeout
);
diff --git a/cpukit/score/src/corerwlockobtainwrite.c b/cpukit/score/src/corerwlockobtainwrite.c
index ea7d25c0e3..3499bcd4c8 100644
--- a/cpukit/score/src/corerwlockobtainwrite.c
+++ b/cpukit/score/src/corerwlockobtainwrite.c
@@ -20,6 +20,7 @@
#include <rtems/score/corerwlockimpl.h>
#include <rtems/score/threadqimpl.h>
+#include <rtems/score/statesimpl.h>
#include <rtems/score/watchdog.h>
void _CORE_RWLock_Obtain_for_writing(
@@ -77,6 +78,7 @@ void _CORE_RWLock_Obtain_for_writing(
_Thread_queue_Enqueue(
&the_rwlock->Wait_queue,
executing,
+ STATES_WAITING_FOR_RWLOCK,
timeout
);
diff --git a/cpukit/score/src/coresem.c b/cpukit/score/src/coresem.c
index 32b34583d0..eb1ba7e283 100644
--- a/cpukit/score/src/coresem.c
+++ b/cpukit/score/src/coresem.c
@@ -19,7 +19,6 @@
#endif
#include <rtems/score/coresemimpl.h>
-#include <rtems/score/statesimpl.h>
void _CORE_semaphore_Initialize(
CORE_semaphore_Control *the_semaphore,
@@ -35,7 +34,6 @@ void _CORE_semaphore_Initialize(
&the_semaphore->Wait_queue,
_CORE_semaphore_Is_priority( the_semaphore_attributes ) ?
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_SEMAPHORE,
CORE_SEMAPHORE_TIMEOUT
);
}
diff --git a/cpukit/score/src/coresemseize.c b/cpukit/score/src/coresemseize.c
index d991af69d6..9c0db96204 100644
--- a/cpukit/score/src/coresemseize.c
+++ b/cpukit/score/src/coresemseize.c
@@ -63,6 +63,11 @@ void _CORE_semaphore_Seize(
executing->Wait.queue = &the_semaphore->Wait_queue;
executing->Wait.id = id;
_ISR_Enable( level );
- _Thread_queue_Enqueue( &the_semaphore->Wait_queue, executing, timeout );
+ _Thread_queue_Enqueue(
+ &the_semaphore->Wait_queue,
+ executing,
+ STATES_WAITING_FOR_SEMAPHORE,
+ timeout
+ );
}
#endif
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c
index a2acf89424..9b623b253f 100644
--- a/cpukit/score/src/mpci.c
+++ b/cpukit/score/src/mpci.c
@@ -83,7 +83,6 @@ void _MPCI_Handler_initialization(
_Thread_queue_Initialize(
&_MPCI_Remote_blocked_threads,
THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_RPC_REPLY,
timeout_status
);
}
@@ -219,12 +218,10 @@ uint32_t _MPCI_Send_request_packet (
_Thread_queue_Enqueue(
&_MPCI_Remote_blocked_threads,
executing,
+ STATES_WAITING_FOR_RPC_REPLY | extra_state,
the_packet->timeout
);
- executing->current_state =
- _States_Set( extra_state, executing->current_state );
-
_Thread_Enable_dispatch();
return executing->Wait.return_code;
diff --git a/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c
index 1f416ba473..bdd380d188 100644
--- a/cpukit/score/src/threadq.c
+++ b/cpukit/score/src/threadq.c
@@ -47,11 +47,9 @@ RBTree_Compare_result _Thread_queue_Compare_priority(
void _Thread_queue_Initialize(
Thread_queue_Control *the_thread_queue,
Thread_queue_Disciplines the_discipline,
- States_Control state,
uint32_t timeout_status
)
{
- the_thread_queue->state = state;
the_thread_queue->discipline = the_discipline;
the_thread_queue->timeout_status = timeout_status;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index 904855156b..5c237560f4 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -104,6 +104,7 @@ static void _Thread_queue_Requeue_priority(
void _Thread_queue_Enqueue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
+ States_Control state,
Watchdog_Interval timeout
)
{
@@ -112,13 +113,13 @@ void _Thread_queue_Enqueue(
#if defined(RTEMS_MULTIPROCESSING)
if ( _Thread_MP_Is_receive( the_thread ) && the_thread->receive_packet )
- the_thread = _Thread_MP_Allocate_proxy( the_thread_queue->state );
+ the_thread = _Thread_MP_Allocate_proxy( state );
else
#endif
/*
* Set the blocking state for this thread queue in the thread.
*/
- _Thread_Set_state( the_thread, the_thread_queue->state );
+ _Thread_Set_state( the_thread, state );
/*
* If the thread wants to timeout, then schedule its timer.
diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c
index 233f3df4b6..240cd1a9e8 100644
--- a/testsuites/sptests/spthreadq01/init.c
+++ b/testsuites/sptests/spthreadq01/init.c
@@ -33,7 +33,7 @@ void threadq_first_empty(
Thread_queue_Control tq;
printf( "Init - initialize thread queue for %s\n", discipline_string );
- _Thread_queue_Initialize( &tq, discipline, 0x01, 3 );
+ _Thread_queue_Initialize( &tq, discipline, 3 );
puts( "Init - _Thread_queue_Extract - thread not blocked on a thread queue" );
_Thread_Disable_dispatch();