summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/rtems++/Task1.cc
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1997-08-26 19:24:22 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1997-08-26 19:24:22 +0000
commit2d6009586815a2e862932b8607bceb34f7706460 (patch)
tree15af7201b16505f54d3c0750a27f316a99ed43b8 /testsuites/libtests/rtems++/Task1.cc
parentremoved -lm (diff)
downloadrtems-2d6009586815a2e862932b8607bceb34f7706460.tar.bz2
Patches from Chris Johns to clean up test.
Diffstat (limited to 'testsuites/libtests/rtems++/Task1.cc')
-rw-r--r--testsuites/libtests/rtems++/Task1.cc31
1 files changed, 28 insertions, 3 deletions
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 <stdlib.h>
#include <string.h>
#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);
+}
+