SYNOPSIS
#include <pthread.h>
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start)(void *), void *arg);
DESCRIPTION
The
At creation, the thread executes start, with arg
as its sole argument.
The calling function must ensure that arg remains valid for
the new thread throughout its lifetime. If start returns,
the effect as if there was an implicit call to
The signal state of the new thread is initialized as follows:
- The signal mask is inherited from the creating thread.
- The set of signal pending for the new thread is empty.
If
PARAMETERS
- thread
-
Is the location where the ID of the newly created thread should be stored, or NULL if the thread ID is not required.
- attr
-
Is the thread attribute object specifying the attributes for the thread that is being created. If attr is NULL, the thread is created with default attributes.
- start
-
Is the main function for the thread; the thread begins executing user code at this address.
- arg
-
Is the argument passed to start.
RETURN VALUES
On success,
- EAGAIN
-
The system lacked the necessary resources to create another thread, or the system-imposed limit on the total number of threads in a process PTHREAD_THREADS_MAX would be exceeded.
- EFAULT
-
thread or attr is an invalid pointer.
- EINVAL
-
attr is not an initialized thread attribute object.
CONFORMANCE
POSIX P1003.1 (1996)
MULTITHREAD SAFETY LEVEL
MT-safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
exit() ,pthread_attr_init() ,pthread_exit() ,pthread_join()
PTC MKS Toolkit 10.4 Documentation Build 39.