summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score
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/include/rtems/score
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/include/rtems/score')
-rw-r--r--cpukit/include/rtems/score/onceimpl.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/include/rtems/score/onceimpl.h b/cpukit/include/rtems/score/onceimpl.h
index 60f1378506..f3afe1cd13 100644
--- a/cpukit/include/rtems/score/onceimpl.h
+++ b/cpukit/include/rtems/score/onceimpl.h
@@ -7,7 +7,7 @@
*/
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014, 2019 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -23,6 +23,8 @@
#ifndef _RTEMS_ONCE_H
#define _RTEMS_ONCE_H
+#include <rtems/score/thread.h>
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -37,11 +39,11 @@ extern "C" {
* @{
*/
-int _Once( unsigned char *once_state, void (*init_routine)(void) );
+int _Once( unsigned char *once_state, void ( *init_routine )( void ) );
-void _Once_Lock( void );
+Thread_Life_state _Once_Lock( void );
-void _Once_Unlock( void );
+void _Once_Unlock( Thread_Life_state thread_life_state );
/** @} */