From 1b1be254e7a3e3d6fe6d55d62010a81a7ef35411 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 25 Mar 2014 10:54:49 +0100 Subject: score: Thread life cycle re-implementation The thread deletion is now supported on SMP. This change fixes the following PRs: PR1814: SMP race condition between stack free and dispatch PR2035: psxcancel reveals NULL pointer access in _Thread_queue_Extract() The POSIX cleanup handler are now called in the right context (should be called in the context of the terminating thread). http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html Add a user extension the reflects a thread termination event. This is used to reclaim the Newlib reentrancy structure (may use file operations), the POSIX cleanup handlers and the POSIX key destructors. --- testsuites/psxtests/psxcleanup01/init.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'testsuites/psxtests/psxcleanup01/init.c') diff --git a/testsuites/psxtests/psxcleanup01/init.c b/testsuites/psxtests/psxcleanup01/init.c index d29a891f54..f38b48ee93 100644 --- a/testsuites/psxtests/psxcleanup01/init.c +++ b/testsuites/psxtests/psxcleanup01/init.c @@ -96,6 +96,15 @@ static void test_restart_with_cleanup(void) wait_for_restart_task(); rtems_test_assert(restart_cleanup_arg == 1); + + wait_for_restart_task(); + + sc = rtems_task_delete(id); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + wait_for_restart_task(); + + rtems_test_assert(restart_cleanup_arg == 2); } static void cleaner(void *arg) -- cgit v1.2.3