summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-23 10:01:22 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-19 12:00:45 +0200
commit02c4c441a51b43b55608893efa4a80a62bb9d4d5 (patch)
tree709655b1c53afc3ff981890989a5290d1c400ad2 /cpukit/posix/src
parentscore: Generalize _Event_Timeout() (diff)
downloadrtems-02c4c441a51b43b55608893efa4a80a62bb9d4d5.tar.bz2
score: Add Thread_queue_Control::Lock
Move the complete thread queue enqueue procedure into _Thread_queue_Enqueue_critical(). It is possible to use the thread queue lock to protect state of the object embedding the thread queue. This enables per object fine grained locking in the future. Delete _Thread_queue_Enter_critical_section(). Update #2273.
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r--cpukit/posix/src/condwaitsupp.c2
-rw-r--r--cpukit/posix/src/psignal.c2
-rw-r--r--cpukit/posix/src/pthread.c2
-rw-r--r--cpukit/posix/src/pthreadjoin.c1
-rw-r--r--cpukit/posix/src/sigtimedwait.c8
5 files changed, 5 insertions, 10 deletions
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c
index 1abdc426fc..8a9e23540c 100644
--- a/cpukit/posix/src/condwaitsupp.c
+++ b/cpukit/posix/src/condwaitsupp.c
@@ -74,10 +74,8 @@ int _POSIX_Condition_variables_Wait_support(
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
- _Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
executing = _Thread_Executing;
executing->Wait.return_code = 0;
- executing->Wait.queue = &the_cond->Wait_queue;
executing->Wait.id = *cond;
_Thread_queue_Enqueue(
diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c
index eec4d95fb5..543b558eac 100644
--- a/cpukit/posix/src/psignal.c
+++ b/cpukit/posix/src/psignal.c
@@ -45,8 +45,6 @@ RTEMS_STATIC_ASSERT(
/*** PROCESS WIDE STUFF ****/
-ISR_lock_Control _POSIX_signals_Lock = ISR_LOCK_INITIALIZER("POSIX signals");
-
sigset_t _POSIX_signals_Pending;
void _POSIX_signals_Abnormal_termination_handler(
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 97882bf4cb..2817891ac5 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -288,6 +288,8 @@ static void _POSIX_Threads_Terminate_extension(
if ( api->schedpolicy == SCHED_SPORADIC )
_Watchdog_Remove_ticks( &api->Sporadic_timer );
+ _Thread_queue_Destroy( &api->Join_List );
+
_Thread_Enable_dispatch();
}
diff --git a/cpukit/posix/src/pthreadjoin.c b/cpukit/posix/src/pthreadjoin.c
index e2b1664b0b..48fb7d58df 100644
--- a/cpukit/posix/src/pthreadjoin.c
+++ b/cpukit/posix/src/pthreadjoin.c
@@ -67,7 +67,6 @@ on_EINTR:
_Thread_Clear_state( the_thread, STATES_WAITING_FOR_JOIN_AT_EXIT );
} else {
executing->Wait.return_argument = &return_pointer;
- _Thread_queue_Enter_critical_section( &api->Join_List );
_Thread_queue_Enqueue(
&api->Join_List,
executing,
diff --git a/cpukit/posix/src/sigtimedwait.c b/cpukit/posix/src/sigtimedwait.c
index 8d86ba72a9..e988761453 100644
--- a/cpukit/posix/src/sigtimedwait.c
+++ b/cpukit/posix/src/sigtimedwait.c
@@ -152,17 +152,15 @@ int sigtimedwait(
the_info->si_signo = -1;
_Thread_Disable_dispatch();
- executing->Wait.queue = &_POSIX_signals_Wait_queue;
executing->Wait.return_code = EINTR;
executing->Wait.option = *set;
executing->Wait.return_argument = the_info;
- _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
- _POSIX_signals_Release( &lock_context );
- _Thread_queue_Enqueue(
+ _Thread_queue_Enqueue_critical(
&_POSIX_signals_Wait_queue,
executing,
STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL,
- interval
+ interval,
+ &lock_context
);
_Thread_Enable_dispatch();