From 9f10911d2b653859f7199eaed5a85a24803711dc Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 22 Apr 2015 21:29:21 +0200 Subject: score: Delete Thread_queue_Control::state Use a parameter for _Thread_queue_Enqueue() instead to reduce memory usage. --- cpukit/posix/src/condinit.c | 1 - cpukit/posix/src/condwaitsupp.c | 9 ++++++++- cpukit/posix/src/psignal.c | 2 -- cpukit/posix/src/pthread.c | 1 - cpukit/posix/src/pthreadjoin.c | 2 ++ cpukit/posix/src/sigtimedwait.c | 7 ++++++- 6 files changed, 16 insertions(+), 6 deletions(-) (limited to 'cpukit/posix') 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 #include +#include #include #include #include @@ -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 #include -#include #include #include #include @@ -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 #include #include +#include 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(); /* -- cgit v1.2.3