diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-02-12 12:19:38 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-02-18 07:25:58 +0100 |
commit | e4ad14cc789090290550e3aa9640e4969037e8b7 (patch) | |
tree | 94d366cf331ee1f5dc10fc4e4298a41ed878acfd /cpukit/rtems | |
parent | libdl/rap: Add the section alloc call after section load was split (diff) | |
download | rtems-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.c | 5 |
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; } |