mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-21 04:14:26 +08:00
simple version of test which shows pthread_create, pthread_exit, and exit
are basically working. This test will be enhanced further.
This commit is contained in:
@@ -25,10 +25,12 @@
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
|
||||
void Init(
|
||||
void *Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
pthread_t thread_id;
|
||||
|
||||
puts( "\n\n*** POSIX TEST 1 ***" );
|
||||
|
||||
@@ -38,5 +40,12 @@ void Init(
|
||||
|
||||
/* exit */
|
||||
|
||||
status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL );
|
||||
assert( !status );
|
||||
|
||||
pthread_exit( NULL );
|
||||
|
||||
/* just to satisfy compilers which think we did not return anything */
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -18,13 +18,14 @@
|
||||
|
||||
#include <bsp.h>
|
||||
#include <pthread.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void Init(
|
||||
void *Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
void Task_1_through_3(
|
||||
void *Task_1_through_3(
|
||||
void *argument
|
||||
);
|
||||
|
||||
|
||||
@@ -21,12 +21,17 @@
|
||||
|
||||
#include "system.h"
|
||||
|
||||
void Task_1_through_3(
|
||||
void *Task_1_through_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int seconds;
|
||||
|
||||
/* XXX temporary */
|
||||
|
||||
puts( "*** END OF POSIX TEST 1 ***" );
|
||||
exit( 0 );
|
||||
|
||||
for ( ; ; ) {
|
||||
/* grab the tod */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user