|
NAMEpthread_create —
create a new thread
LIBRARYPOSIX Threads Library (libpthread, -lpthread)SYNOPSIS#include <pthread.h>
int
DESCRIPTIONThepthread_create () function is used to create a new
thread, with attributes specified by attr, within a
process. If attr is NULL , the
default attributes are used. If the attributes specified by
attr are modified later, the thread's attributes are not
affected. Upon successful completion pthread_create ()
will store the ID of the created thread in the location specified by
thread.
The thread is created executing
start_routine with arg as its
sole argument. If the start_routine returns, the
effect is as if there was an implicit call to
The signal state of the new thread is initialized as:
RETURN VALUESIf successful, thepthread_create () function will return
zero. Otherwise an error number will be returned to indicate the error.
ERRORSThepthread_create () function can return any of the
following errors:
SEE ALSOcpuset_setaffinity(2), fork(2), racct(2), thr_new(2), pthread_attr(3), pthread_cancel(3), pthread_cleanup_pop(3), pthread_cleanup_push(3), pthread_exit(3), pthread_join(3)STANDARDSThepthread_create () function conforms to
ISO/IEC 9945-1:1996 (“POSIX.1”).
Visit the GSP FreeBSD Man Page Interface. |