diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-14 08:56:53 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-14 08:56:53 +0200 |
commit | 6efa3498504bffde166b4663319bd7d94ea42a08 (patch) | |
tree | 7b491ffe458f6570953b60b74ab6867742f734ee /cpukit/posix | |
parent | bsp/qoriq: Fix MMU initialization for e6500 (diff) | |
download | rtems-6efa3498504bffde166b4663319bd7d94ea42a08.tar.bz2 |
posix: Run key destructors during thread restart
POSIX key destructors must be called during thread restart. Just like
the POSIX cleanup handlers. This ensures that the TLS object
destructors are called during thread restart for example. It is
important for the global construction, which uses a thread restart to
run the Init task in a clean environment.
Close #2689.
Diffstat (limited to 'cpukit/posix')
-rw-r--r-- | cpukit/posix/src/key.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/posix/src/key.c b/cpukit/posix/src/key.c index 389a28b878..0bc88ae902 100644 --- a/cpukit/posix/src/key.c +++ b/cpukit/posix/src/key.c @@ -111,8 +111,18 @@ static void _POSIX_Keys_Run_destructors( Thread_Control *the_thread ) } } +static void _POSIX_Keys_Restart_run_destructors( + Thread_Control *executing, + Thread_Control *the_thread +) +{ + (void) executing; + _POSIX_Keys_Run_destructors( the_thread ); +} + static User_extensions_Control _POSIX_Keys_Extensions = { .Callouts = { + .thread_restart = _POSIX_Keys_Restart_run_destructors, .thread_terminate = _POSIX_Keys_Run_destructors } }; |