Changeset 7d96321 in rtems
- Timestamp:
- 10/04/99 19:41:34 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 92b211a
- Parents:
- 811804fe
- Files:
-
- 3 added
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/psxtests/psx08/Makefile.in
r811804fe r7d96321 19 19 20 20 # C source names, if any, go here -- minus the .c 21 C_PIECES = init task task221 C_PIECES=init task1 task2 task3 22 22 C_FILES = $(C_PIECES:%=%.c) 23 23 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) -
c/src/tests/psxtests/psx08/init.c
r811804fe r7d96321 45 45 /* create thread */ 46 46 47 puts( "Init: creating two tasks" ); 48 status = pthread_create( &Task_id, NULL, Task_1, NULL ); 49 assert( !status ); 50 51 status = pthread_create( &Task2_id, NULL, Task_2, NULL ); 47 status = pthread_create( &Task1_id, NULL, Task_1, NULL ); 52 48 assert( !status ); 53 49 … … 57 53 58 54 puts( "Init: pthread_join - SUCCESSFUL" ); 59 status = pthread_join( Task_id, &return_pointer ); 60 /* assert is below comment */ 55 status = pthread_join( Task1_id, &return_pointer ); 61 56 62 /* switch to Task 1 */ 63 64 puts( "Init: returned from pthread_join" ); 57 puts( "Init: returned from pthread_join through return" ); 65 58 if ( status ) 66 59 printf( "status = %d\n", status ); 67 60 assert( !status ); 68 61 69 if ( return_pointer == &Task _id )62 if ( return_pointer == &Task1_id ) 70 63 puts( "Init: pthread_join returned correct pointer" ); 71 64 else … … 73 66 "Init: pthread_join returned incorrect pointer (%p != %p)\n", 74 67 return_pointer, 75 &Task_id 68 &Task1_id 69 ); 70 71 puts( "Init: creating two pthreads" ); 72 status = pthread_create( &Task2_id, NULL, Task_2, NULL ); 73 assert( !status ); 74 75 status = pthread_create( &Task3_id, NULL, Task_3, NULL ); 76 assert( !status ); 77 78 puts( "Init: pthread_join - SUCCESSFUL" ); 79 status = pthread_join( Task2_id, &return_pointer ); 80 /* assert is below comment */ 81 82 puts( "Init: returned from pthread_join through pthread_exit" ); 83 if ( status ) 84 printf( "status = %d\n", status ); 85 assert( !status ); 86 87 if ( return_pointer == &Task2_id ) 88 puts( "Init: pthread_join returned correct pointer" ); 89 else 90 printf( 91 "Init: pthread_join returned incorrect pointer (%p != %p)\n", 92 return_pointer, 93 &Task2_id 76 94 ); 77 95 78 96 puts( "Init: exitting" ); 79 pthread_exit( NULL ); 80 81 return NULL; /* just so the compiler thinks we returned something */ 97 return NULL; 82 98 } -
c/src/tests/psxtests/psx08/psx08.scn
r811804fe r7d96321 3 3 Init: pthread_detach - ESRCH (invalid id) 4 4 Init: pthread_detach self 5 Init: creating two tasks6 5 Init: pthread_join - ESRCH (invalid id) 7 6 Init: pthread_join - SUCCESSFUL 8 Task_1: sleep 1 second9 Task_2: join to Task_110 Task_1: join to detached task (Init) -- EINVAL11 Task_1: join to self task (Init) -- EDEADLK12 7 Task_1: exitting 13 Init: returned from pthread_join 8 Init: returned from pthread_join through return 9 Init: pthread_join returned correct pointer 10 Init: creating two pthreads 11 Init: pthread_join - SUCCESSFUL 12 Task_2: sleep 1 second 13 Task_3: join to Task_2 14 Task_2: join to detached task (Init) -- EINVAL 15 Task_2: join to self task (Init) -- EDEADLK 16 Task_2: exitting 17 Init: returned from pthread_join through pthread_exit 14 18 Init: pthread_join returned correct pointer 15 19 Init: exitting 16 Task_ 2: returned from pthread_join17 Task_ 2: pthread_join returned correct pointer20 Task_3: returned from pthread_join 21 Task_3: pthread_join returned correct pointer 18 22 *** END OF POSIX TEST 8 *** -
c/src/tests/psxtests/psx08/system.h
r811804fe r7d96321 31 31 ); 32 32 33 void *Task_3( 34 void *argument 35 ); 36 33 37 /* configuration information */ 34 38 … … 51 55 52 56 TEST_EXTERN pthread_t Init_id; 53 TEST_EXTERN pthread_t Task _id;57 TEST_EXTERN pthread_t Task1_id; 54 58 TEST_EXTERN pthread_t Task2_id; 59 TEST_EXTERN pthread_t Task3_id; 55 60 56 61 /* end of include file */ -
c/src/tests/psxtests/psx08/task2.c
r811804fe r7d96321 28 28 { 29 29 int status; 30 void *return_pointer;31 30 32 puts( "Task_2: join to Task_1" ); 33 status = pthread_join( Task_id, &return_pointer ); 34 puts( "Task_2: returned from pthread_join" ); 35 if ( status ) 31 puts( "Task_2: sleep 1 second" ); 32 33 sleep( 1 ); 34 35 /* switch to task 3 */ 36 37 puts( "Task_2: join to detached task (Init) -- EINVAL" ); 38 status = pthread_join( Init_id, NULL ); 39 if ( status != EINVAL ) 36 40 printf( "status = %d\n", status ); 37 assert( !status ); 38 39 if ( return_pointer == &Task_id ) 40 puts( "Task_2: pthread_join returned correct pointer" ); 41 else 42 printf( 43 "Task_2: pthread_join returned incorrect pointer (%p != %p)\n", 44 return_pointer, 45 &Task_id 46 ); 41 assert( status == EINVAL ); 42 43 puts( "Task_2: join to self task (Init) -- EDEADLK" ); 44 status = pthread_join( pthread_self(), NULL ); 45 if ( status != EDEADLK ) 46 printf( "status = %d\n", status ); 47 assert( status == EDEADLK ); 47 48 48 puts( "*** END OF POSIX TEST 8 ***" ); 49 exit( 0 ); 49 puts( "Task_2: exitting" ); 50 51 pthread_exit( &Task2_id ); 52 53 /* switch to init task */ 50 54 51 55 return NULL; /* just so the compiler thinks we returned something */ -
c/src/tests/psxtests/psx08/task3.c
r811804fe r7d96321 1 /* Task_ 11 /* Task_3 2 2 * 3 3 * This routine serves as a test task. It verifies the basic task … … 23 23 #include <errno.h> 24 24 25 void *Task_ 1(25 void *Task_3( 26 26 void *argument 27 27 ) 28 28 { 29 29 int status; 30 void *return_pointer; 30 31 31 puts( "Task_1: sleep 1 second" ); 32 puts( "Task_3: join to Task_2" ); 33 status = pthread_join( Task2_id, &return_pointer ); 34 puts( "Task_3: returned from pthread_join" ); 35 if ( status ) 36 printf( "status = %d\n", status ); 37 assert( !status ); 38 39 if ( return_pointer == &Task2_id ) 40 puts( "Task_3: pthread_join returned correct pointer" ); 41 else 42 printf( 43 "Task_3: pthread_join returned incorrect pointer (%p != %p)\n", 44 return_pointer, 45 &Task2_id 46 ); 32 47 33 sleep( 1 ); 34 35 /* switch to task 2 */ 36 37 puts( "Task_1: join to detached task (Init) -- EINVAL" ); 38 status = pthread_join( Init_id, NULL ); 39 if ( status != EINVAL ) 40 printf( "status = %d\n", status ); 41 assert( status == EINVAL ); 42 43 puts( "Task_1: join to self task (Init) -- EDEADLK" ); 44 status = pthread_join( pthread_self(), NULL ); 45 if ( status != EDEADLK ) 46 printf( "status = %d\n", status ); 47 assert( status == EDEADLK ); 48 49 puts( "Task_1: exitting" ); 50 51 pthread_exit( &Task_id ); 52 53 /* switch to init task */ 48 puts( "*** END OF POSIX TEST 8 ***" ); 49 exit( 0 ); 54 50 55 51 return NULL; /* just so the compiler thinks we returned something */ -
testsuites/psxtests/psx08/init.c
r811804fe r7d96321 45 45 /* create thread */ 46 46 47 puts( "Init: creating two tasks" ); 48 status = pthread_create( &Task_id, NULL, Task_1, NULL ); 49 assert( !status ); 50 51 status = pthread_create( &Task2_id, NULL, Task_2, NULL ); 47 status = pthread_create( &Task1_id, NULL, Task_1, NULL ); 52 48 assert( !status ); 53 49 … … 57 53 58 54 puts( "Init: pthread_join - SUCCESSFUL" ); 59 status = pthread_join( Task_id, &return_pointer ); 60 /* assert is below comment */ 55 status = pthread_join( Task1_id, &return_pointer ); 61 56 62 /* switch to Task 1 */ 63 64 puts( "Init: returned from pthread_join" ); 57 puts( "Init: returned from pthread_join through return" ); 65 58 if ( status ) 66 59 printf( "status = %d\n", status ); 67 60 assert( !status ); 68 61 69 if ( return_pointer == &Task _id )62 if ( return_pointer == &Task1_id ) 70 63 puts( "Init: pthread_join returned correct pointer" ); 71 64 else … … 73 66 "Init: pthread_join returned incorrect pointer (%p != %p)\n", 74 67 return_pointer, 75 &Task_id 68 &Task1_id 69 ); 70 71 puts( "Init: creating two pthreads" ); 72 status = pthread_create( &Task2_id, NULL, Task_2, NULL ); 73 assert( !status ); 74 75 status = pthread_create( &Task3_id, NULL, Task_3, NULL ); 76 assert( !status ); 77 78 puts( "Init: pthread_join - SUCCESSFUL" ); 79 status = pthread_join( Task2_id, &return_pointer ); 80 /* assert is below comment */ 81 82 puts( "Init: returned from pthread_join through pthread_exit" ); 83 if ( status ) 84 printf( "status = %d\n", status ); 85 assert( !status ); 86 87 if ( return_pointer == &Task2_id ) 88 puts( "Init: pthread_join returned correct pointer" ); 89 else 90 printf( 91 "Init: pthread_join returned incorrect pointer (%p != %p)\n", 92 return_pointer, 93 &Task2_id 76 94 ); 77 95 78 96 puts( "Init: exitting" ); 79 pthread_exit( NULL ); 80 81 return NULL; /* just so the compiler thinks we returned something */ 97 return NULL; 82 98 } -
testsuites/psxtests/psx08/psx08.scn
r811804fe r7d96321 3 3 Init: pthread_detach - ESRCH (invalid id) 4 4 Init: pthread_detach self 5 Init: creating two tasks6 5 Init: pthread_join - ESRCH (invalid id) 7 6 Init: pthread_join - SUCCESSFUL 8 Task_1: sleep 1 second9 Task_2: join to Task_110 Task_1: join to detached task (Init) -- EINVAL11 Task_1: join to self task (Init) -- EDEADLK12 7 Task_1: exitting 13 Init: returned from pthread_join 8 Init: returned from pthread_join through return 9 Init: pthread_join returned correct pointer 10 Init: creating two pthreads 11 Init: pthread_join - SUCCESSFUL 12 Task_2: sleep 1 second 13 Task_3: join to Task_2 14 Task_2: join to detached task (Init) -- EINVAL 15 Task_2: join to self task (Init) -- EDEADLK 16 Task_2: exitting 17 Init: returned from pthread_join through pthread_exit 14 18 Init: pthread_join returned correct pointer 15 19 Init: exitting 16 Task_ 2: returned from pthread_join17 Task_ 2: pthread_join returned correct pointer20 Task_3: returned from pthread_join 21 Task_3: pthread_join returned correct pointer 18 22 *** END OF POSIX TEST 8 *** -
testsuites/psxtests/psx08/system.h
r811804fe r7d96321 31 31 ); 32 32 33 void *Task_3( 34 void *argument 35 ); 36 33 37 /* configuration information */ 34 38 … … 51 55 52 56 TEST_EXTERN pthread_t Init_id; 53 TEST_EXTERN pthread_t Task _id;57 TEST_EXTERN pthread_t Task1_id; 54 58 TEST_EXTERN pthread_t Task2_id; 59 TEST_EXTERN pthread_t Task3_id; 55 60 56 61 /* end of include file */ -
testsuites/psxtests/psx08/task2.c
r811804fe r7d96321 28 28 { 29 29 int status; 30 void *return_pointer;31 30 32 puts( "Task_2: join to Task_1" ); 33 status = pthread_join( Task_id, &return_pointer ); 34 puts( "Task_2: returned from pthread_join" ); 35 if ( status ) 31 puts( "Task_2: sleep 1 second" ); 32 33 sleep( 1 ); 34 35 /* switch to task 3 */ 36 37 puts( "Task_2: join to detached task (Init) -- EINVAL" ); 38 status = pthread_join( Init_id, NULL ); 39 if ( status != EINVAL ) 36 40 printf( "status = %d\n", status ); 37 assert( !status ); 38 39 if ( return_pointer == &Task_id ) 40 puts( "Task_2: pthread_join returned correct pointer" ); 41 else 42 printf( 43 "Task_2: pthread_join returned incorrect pointer (%p != %p)\n", 44 return_pointer, 45 &Task_id 46 ); 41 assert( status == EINVAL ); 42 43 puts( "Task_2: join to self task (Init) -- EDEADLK" ); 44 status = pthread_join( pthread_self(), NULL ); 45 if ( status != EDEADLK ) 46 printf( "status = %d\n", status ); 47 assert( status == EDEADLK ); 47 48 48 puts( "*** END OF POSIX TEST 8 ***" ); 49 exit( 0 ); 49 puts( "Task_2: exitting" ); 50 51 pthread_exit( &Task2_id ); 52 53 /* switch to init task */ 50 54 51 55 return NULL; /* just so the compiler thinks we returned something */
Note: See TracChangeset
for help on using the changeset viewer.