diff options
author | Mark Johannes <Mark.Johannes@OARcorp.com> | 1996-06-13 22:16:08 +0000 |
---|---|---|
committer | Mark Johannes <Mark.Johannes@OARcorp.com> | 1996-06-13 22:16:08 +0000 |
commit | 36197e539ef1c80b6df969c80634736dbbced9bf (patch) | |
tree | 18bf9d8e6c6c9da97e548224a443a7c01457cb9a /testsuites/psxtests/psx03/task.c | |
parent | added maximum_queued_signals to _POSIX_Default_configuration (diff) | |
download | rtems-36197e539ef1c80b6df969c80634736dbbced9bf.tar.bz2 |
first successful run. Has test cases for a simple sigtimedwait() timeout,
a sigtimewait() timeout because it was pthread_kill'ed with a blocked
signal, and a sigtimedwait which is satisfied.
Diffstat (limited to 'testsuites/psxtests/psx03/task.c')
-rw-r--r-- | testsuites/psxtests/psx03/task.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/testsuites/psxtests/psx03/task.c b/testsuites/psxtests/psx03/task.c new file mode 100644 index 0000000000..5c7b1ca753 --- /dev/null +++ b/testsuites/psxtests/psx03/task.c @@ -0,0 +1,61 @@ +/* Task_1_through_3 + * + * This routine serves as a test task. It verifies the basic task + * switching capabilities of the executive. + * + * Input parameters: + * argument - task argument + * + * Output parameters: NONE + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#include "system.h" +#include <signal.h> + +void *Task_1( + void *argument +) +{ + int status; + + /* send SIGUSR2 to Init which is waiting on SIGUSR1 */ + + print_current_time( "Task1: ", "" ); + status = pthread_kill( Init_id, SIGUSR2 ); + assert( !status ); + + pthread_exit( NULL ); + + /* switch to Init */ + + return NULL; /* just so the compiler thinks we returned something */ +} + +void *Task_2( + void *argument +) +{ + int status; + + /* send SIGUSR1 to Init which is waiting on SIGUSR1 */ + + print_current_time( "Task2: ", "" ); + status = pthread_kill( Init_id, SIGUSR1 ); + assert( !status ); + + pthread_exit( NULL ); + + /* switch to Init */ + + return NULL; /* just so the compiler thinks we returned something */ +} |