forked from Imagelibrary/rtems
Modifications necessary to support testing of exitting a pthread from
Charles-Antione Gauthier <charles.gauthier@iit.nrc.ca>.
This commit is contained in:
@@ -18,7 +18,7 @@ TEST = psx08
|
|||||||
MANAGERS = all
|
MANAGERS = all
|
||||||
|
|
||||||
# C source names, if any, go here -- minus the .c
|
# C source names, if any, go here -- minus the .c
|
||||||
C_PIECES = init task task2
|
C_PIECES=init task1 task2 task3
|
||||||
C_FILES = $(C_PIECES:%=%.c)
|
C_FILES = $(C_PIECES:%=%.c)
|
||||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||||
|
|
||||||
|
|||||||
@@ -44,11 +44,7 @@ void *POSIX_Init(
|
|||||||
|
|
||||||
/* create thread */
|
/* create thread */
|
||||||
|
|
||||||
puts( "Init: creating two tasks" );
|
status = pthread_create( &Task1_id, NULL, Task_1, NULL );
|
||||||
status = pthread_create( &Task_id, NULL, Task_1, NULL );
|
|
||||||
assert( !status );
|
|
||||||
|
|
||||||
status = pthread_create( &Task2_id, NULL, Task_2, NULL );
|
|
||||||
assert( !status );
|
assert( !status );
|
||||||
|
|
||||||
puts( "Init: pthread_join - ESRCH (invalid id)" );
|
puts( "Init: pthread_join - ESRCH (invalid id)" );
|
||||||
@@ -56,27 +52,47 @@ void *POSIX_Init(
|
|||||||
assert( status == ESRCH );
|
assert( status == ESRCH );
|
||||||
|
|
||||||
puts( "Init: pthread_join - SUCCESSFUL" );
|
puts( "Init: pthread_join - SUCCESSFUL" );
|
||||||
status = pthread_join( Task_id, &return_pointer );
|
status = pthread_join( Task1_id, &return_pointer );
|
||||||
/* assert is below comment */
|
|
||||||
|
|
||||||
/* switch to Task 1 */
|
puts( "Init: returned from pthread_join through return" );
|
||||||
|
|
||||||
puts( "Init: returned from pthread_join" );
|
|
||||||
if ( status )
|
if ( status )
|
||||||
printf( "status = %d\n", status );
|
printf( "status = %d\n", status );
|
||||||
assert( !status );
|
assert( !status );
|
||||||
|
|
||||||
if ( return_pointer == &Task_id )
|
if ( return_pointer == &Task1_id )
|
||||||
puts( "Init: pthread_join returned correct pointer" );
|
puts( "Init: pthread_join returned correct pointer" );
|
||||||
else
|
else
|
||||||
printf(
|
printf(
|
||||||
"Init: pthread_join returned incorrect pointer (%p != %p)\n",
|
"Init: pthread_join returned incorrect pointer (%p != %p)\n",
|
||||||
return_pointer,
|
return_pointer,
|
||||||
&Task_id
|
&Task1_id
|
||||||
|
);
|
||||||
|
|
||||||
|
puts( "Init: creating two pthreads" );
|
||||||
|
status = pthread_create( &Task2_id, NULL, Task_2, NULL );
|
||||||
|
assert( !status );
|
||||||
|
|
||||||
|
status = pthread_create( &Task3_id, NULL, Task_3, NULL );
|
||||||
|
assert( !status );
|
||||||
|
|
||||||
|
puts( "Init: pthread_join - SUCCESSFUL" );
|
||||||
|
status = pthread_join( Task2_id, &return_pointer );
|
||||||
|
/* assert is below comment */
|
||||||
|
|
||||||
|
puts( "Init: returned from pthread_join through pthread_exit" );
|
||||||
|
if ( status )
|
||||||
|
printf( "status = %d\n", status );
|
||||||
|
assert( !status );
|
||||||
|
|
||||||
|
if ( return_pointer == &Task2_id )
|
||||||
|
puts( "Init: pthread_join returned correct pointer" );
|
||||||
|
else
|
||||||
|
printf(
|
||||||
|
"Init: pthread_join returned incorrect pointer (%p != %p)\n",
|
||||||
|
return_pointer,
|
||||||
|
&Task2_id
|
||||||
);
|
);
|
||||||
|
|
||||||
puts( "Init: exitting" );
|
puts( "Init: exitting" );
|
||||||
pthread_exit( NULL );
|
return NULL;
|
||||||
|
|
||||||
return NULL; /* just so the compiler thinks we returned something */
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,21 @@
|
|||||||
Init's ID is 0x0c010001
|
Init's ID is 0x0c010001
|
||||||
Init: pthread_detach - ESRCH (invalid id)
|
Init: pthread_detach - ESRCH (invalid id)
|
||||||
Init: pthread_detach self
|
Init: pthread_detach self
|
||||||
Init: creating two tasks
|
|
||||||
Init: pthread_join - ESRCH (invalid id)
|
Init: pthread_join - ESRCH (invalid id)
|
||||||
Init: pthread_join - SUCCESSFUL
|
Init: pthread_join - SUCCESSFUL
|
||||||
Task_1: sleep 1 second
|
|
||||||
Task_2: join to Task_1
|
|
||||||
Task_1: join to detached task (Init) -- EINVAL
|
|
||||||
Task_1: join to self task (Init) -- EDEADLK
|
|
||||||
Task_1: exitting
|
Task_1: exitting
|
||||||
Init: returned from pthread_join
|
Init: returned from pthread_join through return
|
||||||
|
Init: pthread_join returned correct pointer
|
||||||
|
Init: creating two pthreads
|
||||||
|
Init: pthread_join - SUCCESSFUL
|
||||||
|
Task_2: sleep 1 second
|
||||||
|
Task_3: join to Task_2
|
||||||
|
Task_2: join to detached task (Init) -- EINVAL
|
||||||
|
Task_2: join to self task (Init) -- EDEADLK
|
||||||
|
Task_2: exitting
|
||||||
|
Init: returned from pthread_join through pthread_exit
|
||||||
Init: pthread_join returned correct pointer
|
Init: pthread_join returned correct pointer
|
||||||
Init: exitting
|
Init: exitting
|
||||||
Task_2: returned from pthread_join
|
Task_3: returned from pthread_join
|
||||||
Task_2: pthread_join returned correct pointer
|
Task_3: pthread_join returned correct pointer
|
||||||
*** END OF POSIX TEST 8 ***
|
*** END OF POSIX TEST 8 ***
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ void *Task_2(
|
|||||||
void *argument
|
void *argument
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void *Task_3(
|
||||||
|
void *argument
|
||||||
|
);
|
||||||
|
|
||||||
/* configuration information */
|
/* configuration information */
|
||||||
|
|
||||||
#define CONFIGURE_SPTEST
|
#define CONFIGURE_SPTEST
|
||||||
@@ -50,7 +54,8 @@ void *Task_2(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
TEST_EXTERN pthread_t Init_id;
|
TEST_EXTERN pthread_t Init_id;
|
||||||
TEST_EXTERN pthread_t Task_id;
|
TEST_EXTERN pthread_t Task1_id;
|
||||||
TEST_EXTERN pthread_t Task2_id;
|
TEST_EXTERN pthread_t Task2_id;
|
||||||
|
TEST_EXTERN pthread_t Task3_id;
|
||||||
|
|
||||||
/* end of include file */
|
/* end of include file */
|
||||||
|
|||||||
34
c/src/tests/psxtests/psx08/task1.c
Normal file
34
c/src/tests/psxtests/psx08/task1.c
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/* Task_1
|
||||||
|
*
|
||||||
|
* 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-1998.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "system.h"
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
void *Task_1(
|
||||||
|
void *argument
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
|
||||||
|
puts( "Task_1: exitting" );
|
||||||
|
|
||||||
|
return( &Task1_id );
|
||||||
|
}
|
||||||
@@ -27,26 +27,30 @@ void *Task_2(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
void *return_pointer;
|
|
||||||
|
|
||||||
puts( "Task_2: join to Task_1" );
|
puts( "Task_2: sleep 1 second" );
|
||||||
status = pthread_join( Task_id, &return_pointer );
|
|
||||||
puts( "Task_2: returned from pthread_join" );
|
sleep( 1 );
|
||||||
if ( status )
|
|
||||||
|
/* switch to task 3 */
|
||||||
|
|
||||||
|
puts( "Task_2: join to detached task (Init) -- EINVAL" );
|
||||||
|
status = pthread_join( Init_id, NULL );
|
||||||
|
if ( status != EINVAL )
|
||||||
printf( "status = %d\n", status );
|
printf( "status = %d\n", status );
|
||||||
assert( !status );
|
assert( status == EINVAL );
|
||||||
|
|
||||||
if ( return_pointer == &Task_id )
|
puts( "Task_2: join to self task (Init) -- EDEADLK" );
|
||||||
puts( "Task_2: pthread_join returned correct pointer" );
|
status = pthread_join( pthread_self(), NULL );
|
||||||
else
|
if ( status != EDEADLK )
|
||||||
printf(
|
printf( "status = %d\n", status );
|
||||||
"Task_2: pthread_join returned incorrect pointer (%p != %p)\n",
|
assert( status == EDEADLK );
|
||||||
return_pointer,
|
|
||||||
&Task_id
|
|
||||||
);
|
|
||||||
|
|
||||||
puts( "*** END OF POSIX TEST 8 ***" );
|
puts( "Task_2: exitting" );
|
||||||
exit( 0 );
|
|
||||||
|
pthread_exit( &Task2_id );
|
||||||
|
|
||||||
|
/* switch to init task */
|
||||||
|
|
||||||
return NULL; /* just so the compiler thinks we returned something */
|
return NULL; /* just so the compiler thinks we returned something */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* Task_1
|
/* Task_3
|
||||||
*
|
*
|
||||||
* This routine serves as a test task. It verifies the basic task
|
* This routine serves as a test task. It verifies the basic task
|
||||||
* switching capabilities of the executive.
|
* switching capabilities of the executive.
|
||||||
@@ -22,35 +22,31 @@
|
|||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
void *Task_1(
|
void *Task_3(
|
||||||
void *argument
|
void *argument
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
void *return_pointer;
|
||||||
|
|
||||||
puts( "Task_1: sleep 1 second" );
|
puts( "Task_3: join to Task_2" );
|
||||||
|
status = pthread_join( Task2_id, &return_pointer );
|
||||||
sleep( 1 );
|
puts( "Task_3: returned from pthread_join" );
|
||||||
|
if ( status )
|
||||||
/* switch to task 2 */
|
|
||||||
|
|
||||||
puts( "Task_1: join to detached task (Init) -- EINVAL" );
|
|
||||||
status = pthread_join( Init_id, NULL );
|
|
||||||
if ( status != EINVAL )
|
|
||||||
printf( "status = %d\n", status );
|
printf( "status = %d\n", status );
|
||||||
assert( status == EINVAL );
|
assert( !status );
|
||||||
|
|
||||||
puts( "Task_1: join to self task (Init) -- EDEADLK" );
|
if ( return_pointer == &Task2_id )
|
||||||
status = pthread_join( pthread_self(), NULL );
|
puts( "Task_3: pthread_join returned correct pointer" );
|
||||||
if ( status != EDEADLK )
|
else
|
||||||
printf( "status = %d\n", status );
|
printf(
|
||||||
assert( status == EDEADLK );
|
"Task_3: pthread_join returned incorrect pointer (%p != %p)\n",
|
||||||
|
return_pointer,
|
||||||
|
&Task2_id
|
||||||
|
);
|
||||||
|
|
||||||
puts( "Task_1: exitting" );
|
puts( "*** END OF POSIX TEST 8 ***" );
|
||||||
|
exit( 0 );
|
||||||
pthread_exit( &Task_id );
|
|
||||||
|
|
||||||
/* switch to init task */
|
|
||||||
|
|
||||||
return NULL; /* just so the compiler thinks we returned something */
|
return NULL; /* just so the compiler thinks we returned something */
|
||||||
}
|
}
|
||||||
@@ -44,11 +44,7 @@ void *POSIX_Init(
|
|||||||
|
|
||||||
/* create thread */
|
/* create thread */
|
||||||
|
|
||||||
puts( "Init: creating two tasks" );
|
status = pthread_create( &Task1_id, NULL, Task_1, NULL );
|
||||||
status = pthread_create( &Task_id, NULL, Task_1, NULL );
|
|
||||||
assert( !status );
|
|
||||||
|
|
||||||
status = pthread_create( &Task2_id, NULL, Task_2, NULL );
|
|
||||||
assert( !status );
|
assert( !status );
|
||||||
|
|
||||||
puts( "Init: pthread_join - ESRCH (invalid id)" );
|
puts( "Init: pthread_join - ESRCH (invalid id)" );
|
||||||
@@ -56,27 +52,47 @@ void *POSIX_Init(
|
|||||||
assert( status == ESRCH );
|
assert( status == ESRCH );
|
||||||
|
|
||||||
puts( "Init: pthread_join - SUCCESSFUL" );
|
puts( "Init: pthread_join - SUCCESSFUL" );
|
||||||
status = pthread_join( Task_id, &return_pointer );
|
status = pthread_join( Task1_id, &return_pointer );
|
||||||
/* assert is below comment */
|
|
||||||
|
|
||||||
/* switch to Task 1 */
|
puts( "Init: returned from pthread_join through return" );
|
||||||
|
|
||||||
puts( "Init: returned from pthread_join" );
|
|
||||||
if ( status )
|
if ( status )
|
||||||
printf( "status = %d\n", status );
|
printf( "status = %d\n", status );
|
||||||
assert( !status );
|
assert( !status );
|
||||||
|
|
||||||
if ( return_pointer == &Task_id )
|
if ( return_pointer == &Task1_id )
|
||||||
puts( "Init: pthread_join returned correct pointer" );
|
puts( "Init: pthread_join returned correct pointer" );
|
||||||
else
|
else
|
||||||
printf(
|
printf(
|
||||||
"Init: pthread_join returned incorrect pointer (%p != %p)\n",
|
"Init: pthread_join returned incorrect pointer (%p != %p)\n",
|
||||||
return_pointer,
|
return_pointer,
|
||||||
&Task_id
|
&Task1_id
|
||||||
|
);
|
||||||
|
|
||||||
|
puts( "Init: creating two pthreads" );
|
||||||
|
status = pthread_create( &Task2_id, NULL, Task_2, NULL );
|
||||||
|
assert( !status );
|
||||||
|
|
||||||
|
status = pthread_create( &Task3_id, NULL, Task_3, NULL );
|
||||||
|
assert( !status );
|
||||||
|
|
||||||
|
puts( "Init: pthread_join - SUCCESSFUL" );
|
||||||
|
status = pthread_join( Task2_id, &return_pointer );
|
||||||
|
/* assert is below comment */
|
||||||
|
|
||||||
|
puts( "Init: returned from pthread_join through pthread_exit" );
|
||||||
|
if ( status )
|
||||||
|
printf( "status = %d\n", status );
|
||||||
|
assert( !status );
|
||||||
|
|
||||||
|
if ( return_pointer == &Task2_id )
|
||||||
|
puts( "Init: pthread_join returned correct pointer" );
|
||||||
|
else
|
||||||
|
printf(
|
||||||
|
"Init: pthread_join returned incorrect pointer (%p != %p)\n",
|
||||||
|
return_pointer,
|
||||||
|
&Task2_id
|
||||||
);
|
);
|
||||||
|
|
||||||
puts( "Init: exitting" );
|
puts( "Init: exitting" );
|
||||||
pthread_exit( NULL );
|
return NULL;
|
||||||
|
|
||||||
return NULL; /* just so the compiler thinks we returned something */
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,21 @@
|
|||||||
Init's ID is 0x0c010001
|
Init's ID is 0x0c010001
|
||||||
Init: pthread_detach - ESRCH (invalid id)
|
Init: pthread_detach - ESRCH (invalid id)
|
||||||
Init: pthread_detach self
|
Init: pthread_detach self
|
||||||
Init: creating two tasks
|
|
||||||
Init: pthread_join - ESRCH (invalid id)
|
Init: pthread_join - ESRCH (invalid id)
|
||||||
Init: pthread_join - SUCCESSFUL
|
Init: pthread_join - SUCCESSFUL
|
||||||
Task_1: sleep 1 second
|
|
||||||
Task_2: join to Task_1
|
|
||||||
Task_1: join to detached task (Init) -- EINVAL
|
|
||||||
Task_1: join to self task (Init) -- EDEADLK
|
|
||||||
Task_1: exitting
|
Task_1: exitting
|
||||||
Init: returned from pthread_join
|
Init: returned from pthread_join through return
|
||||||
|
Init: pthread_join returned correct pointer
|
||||||
|
Init: creating two pthreads
|
||||||
|
Init: pthread_join - SUCCESSFUL
|
||||||
|
Task_2: sleep 1 second
|
||||||
|
Task_3: join to Task_2
|
||||||
|
Task_2: join to detached task (Init) -- EINVAL
|
||||||
|
Task_2: join to self task (Init) -- EDEADLK
|
||||||
|
Task_2: exitting
|
||||||
|
Init: returned from pthread_join through pthread_exit
|
||||||
Init: pthread_join returned correct pointer
|
Init: pthread_join returned correct pointer
|
||||||
Init: exitting
|
Init: exitting
|
||||||
Task_2: returned from pthread_join
|
Task_3: returned from pthread_join
|
||||||
Task_2: pthread_join returned correct pointer
|
Task_3: pthread_join returned correct pointer
|
||||||
*** END OF POSIX TEST 8 ***
|
*** END OF POSIX TEST 8 ***
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ void *Task_2(
|
|||||||
void *argument
|
void *argument
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void *Task_3(
|
||||||
|
void *argument
|
||||||
|
);
|
||||||
|
|
||||||
/* configuration information */
|
/* configuration information */
|
||||||
|
|
||||||
#define CONFIGURE_SPTEST
|
#define CONFIGURE_SPTEST
|
||||||
@@ -50,7 +54,8 @@ void *Task_2(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
TEST_EXTERN pthread_t Init_id;
|
TEST_EXTERN pthread_t Init_id;
|
||||||
TEST_EXTERN pthread_t Task_id;
|
TEST_EXTERN pthread_t Task1_id;
|
||||||
TEST_EXTERN pthread_t Task2_id;
|
TEST_EXTERN pthread_t Task2_id;
|
||||||
|
TEST_EXTERN pthread_t Task3_id;
|
||||||
|
|
||||||
/* end of include file */
|
/* end of include file */
|
||||||
|
|||||||
34
testsuites/psxtests/psx08/task1.c
Normal file
34
testsuites/psxtests/psx08/task1.c
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/* Task_1
|
||||||
|
*
|
||||||
|
* 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-1998.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "system.h"
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
void *Task_1(
|
||||||
|
void *argument
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
|
||||||
|
puts( "Task_1: exitting" );
|
||||||
|
|
||||||
|
return( &Task1_id );
|
||||||
|
}
|
||||||
@@ -27,26 +27,30 @@ void *Task_2(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
void *return_pointer;
|
|
||||||
|
|
||||||
puts( "Task_2: join to Task_1" );
|
puts( "Task_2: sleep 1 second" );
|
||||||
status = pthread_join( Task_id, &return_pointer );
|
|
||||||
puts( "Task_2: returned from pthread_join" );
|
sleep( 1 );
|
||||||
if ( status )
|
|
||||||
|
/* switch to task 3 */
|
||||||
|
|
||||||
|
puts( "Task_2: join to detached task (Init) -- EINVAL" );
|
||||||
|
status = pthread_join( Init_id, NULL );
|
||||||
|
if ( status != EINVAL )
|
||||||
printf( "status = %d\n", status );
|
printf( "status = %d\n", status );
|
||||||
assert( !status );
|
assert( status == EINVAL );
|
||||||
|
|
||||||
if ( return_pointer == &Task_id )
|
puts( "Task_2: join to self task (Init) -- EDEADLK" );
|
||||||
puts( "Task_2: pthread_join returned correct pointer" );
|
status = pthread_join( pthread_self(), NULL );
|
||||||
else
|
if ( status != EDEADLK )
|
||||||
printf(
|
printf( "status = %d\n", status );
|
||||||
"Task_2: pthread_join returned incorrect pointer (%p != %p)\n",
|
assert( status == EDEADLK );
|
||||||
return_pointer,
|
|
||||||
&Task_id
|
|
||||||
);
|
|
||||||
|
|
||||||
puts( "*** END OF POSIX TEST 8 ***" );
|
puts( "Task_2: exitting" );
|
||||||
exit( 0 );
|
|
||||||
|
pthread_exit( &Task2_id );
|
||||||
|
|
||||||
|
/* switch to init task */
|
||||||
|
|
||||||
return NULL; /* just so the compiler thinks we returned something */
|
return NULL; /* just so the compiler thinks we returned something */
|
||||||
}
|
}
|
||||||
|
|||||||
52
testsuites/psxtests/psx08/task3.c
Normal file
52
testsuites/psxtests/psx08/task3.c
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/* Task_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-1998.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "system.h"
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
void *Task_3(
|
||||||
|
void *argument
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
void *return_pointer;
|
||||||
|
|
||||||
|
puts( "Task_3: join to Task_2" );
|
||||||
|
status = pthread_join( Task2_id, &return_pointer );
|
||||||
|
puts( "Task_3: returned from pthread_join" );
|
||||||
|
if ( status )
|
||||||
|
printf( "status = %d\n", status );
|
||||||
|
assert( !status );
|
||||||
|
|
||||||
|
if ( return_pointer == &Task2_id )
|
||||||
|
puts( "Task_3: pthread_join returned correct pointer" );
|
||||||
|
else
|
||||||
|
printf(
|
||||||
|
"Task_3: pthread_join returned incorrect pointer (%p != %p)\n",
|
||||||
|
return_pointer,
|
||||||
|
&Task2_id
|
||||||
|
);
|
||||||
|
|
||||||
|
puts( "*** END OF POSIX TEST 8 ***" );
|
||||||
|
exit( 0 );
|
||||||
|
|
||||||
|
return NULL; /* just so the compiler thinks we returned something */
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user