Creates a new thread.
#include <pthread.h>
int pthread_create (
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)(void *),
void *arg);
(OUT) Points to the ID of the newly created thread. If you do not need the ID, pass in NULL.
(IN) Points to the attributes for the newly created thread. If NULL is specified, a pthread_attr_t structure is created and the fields are set so that the thread is joinable and has a medium priority and a default stack size.
To set your own attribute values, you must first initialize the pthread_attr_t structure with the pthread_attr_init function and then call the pthread_attr_set... family of functions.
(IN) Points to the function on which the thread should start executing.
(IN) Points to an argument passed to the start_routine.
If successful, returns 0. Otherwise, returns a nonzero error code:
When an application is loaded, the NetWare operating system creates an initial thread of control for the application. The pthread_create function creates a new thread of control for the application. The thread is created executing start_routine with arg as its sole argument. If the start_routine returns, the effect is as if pthread_exit was called, using the return value of start_routine as the exit status. The thread in which main was originally invoked differs from this process. When it returns from main, the effect is as if exit was called, using the return value of main as the exit status.
The signal state of the new thread is initialized as follows:
The signal mask is inherited from the creating thread.
The set of signals pending for the new thread is empty.
If pthread_create fails, no new thread is created, and the contents of the thread parameter are undefined.