summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-02-12 12:19:38 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-02-18 07:25:58 +0100
commite4ad14cc789090290550e3aa9640e4969037e8b7 (patch)
tree94d366cf331ee1f5dc10fc4e4298a41ed878acfd /cpukit/rtems
parentlibdl/rap: Add the section alloc call after section load was split (diff)
downloadrtems-e4ad14cc789090290550e3aa9640e4969037e8b7.tar.bz2
score: Avoid some deadlocks in _Once()
Recursive usage of the same pthread_once_t results now in a deadlock. Previously, an error of EINVAL was returned. This usage scenario is invalid according to the POSIX pthread_once() specification. Close #3334.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/src/timerserver.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index 09e792aa1c..55c3d96b9b 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -228,10 +228,11 @@ rtems_status_code rtems_timer_initiate_server(
)
{
rtems_status_code status;
+ Thread_Life_state thread_life_state;
- _Once_Lock();
+ thread_life_state = _Once_Lock();
status = _Timer_server_Initiate( priority, stack_size, attribute_set );
- _Once_Unlock();
+ _Once_Unlock( thread_life_state );
return status;
}