From 2d6009586815a2e862932b8607bceb34f7706460 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 26 Aug 1997 19:24:22 +0000 Subject: Patches from Chris Johns to clean up test. --- testsuites/libtests/rtems++/Task1.cc | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'testsuites/libtests/rtems++/Task1.cc') diff --git a/testsuites/libtests/rtems++/Task1.cc b/testsuites/libtests/rtems++/Task1.cc index c6212c8c26..5dbd4d7ea9 100644 --- a/testsuites/libtests/rtems++/Task1.cc +++ b/testsuites/libtests/rtems++/Task1.cc @@ -23,6 +23,7 @@ * $Id$ */ +#include #include #include "System.h" @@ -54,10 +55,20 @@ void Task1::body(rtems_task_argument argument) rtems_test_pause_and_screen_number(6); screen6(); - rtems_test_pause_and_screen_number(7); - // causes init to delete me and itself - end_init.send(RTEMS_SIGNAL_0); + // do not call exit(0) from this thread as this object is static + // the static destructor call delete the task which is calling exit + // so exit never completes + + EndTask end_task("ENDT", (rtems_task_priority) 1, RTEMS_MINIMUM_STACK_SIZE * 6); + end_task.start(0); + + rtemsEvent block_me; + rtems_event_set out; + + block_me.receive(RTEMS_SIGNAL_0, out); + + printf("**** TASK 1 did not block ????\n"); } void Task1::screen1(void) @@ -655,3 +666,17 @@ void Task1::print_mode(rtems_mode mode, rtems_mode mask) printf("INTMASK=%i", mode & RTEMS_INTERRUPT_MASK); } + +EndTask::EndTask(const char* name, + const rtems_task_priority initial_priority, + const rtems_unsigned32 stack_size) + : rtemsTask(name, initial_priority, stack_size, RTEMS_NO_PREEMPT) +{ +} + +void EndTask::body(rtems_task_argument ) +{ + printf("*** END OF RTEMS++ TEST ***\n"); + exit(0); +} + -- cgit v1.2.3