#include <pthread.h> int pthread_create( pthread_t *thread, const pthread_attr_t *attr, void (*start_routine)( void *), void *arg );
The pthread_create
routine is used to create a new thread with
the attributes specified by attr
. If the attr
argument
is NULL
, then the default attribute set will be used. Modification
of the contents of attr
after this thread is created does not
have an impact on this thread.
The thread begins execution at the address specified by start_routine
with arg
as its only argument. If start_routine
returns,
then it is functionally equivalent to the thread executing the
pthread_exit
service.
Upon successful completion, the ID of the created thread is returned in the
thread
argument.
There is no concept of a single main thread in RTEMS as there is in
a tradition UNIX system. POSIX requires that the implicit return of
the main thread results in the same effects as if there were a call
to exit
. This does not occur in RTEMS.
The signal mask of the newly created thread is inherited from its creator and the set of pending signals for this thread is empty.
Copyright © 1988-2004 OAR Corporation