Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
Table 18 Thread Functions With Changed Parameters (continued)
Syntax of Standard POSIX Threads FunctionSyntax of Draft 4 Thread Function
pthread_startroutine_t
start_routine,
pthread_addr_t arg);
void * (*start_routine) (void *),
void *arg);
int pthread_detach(pthread_t thread);int pthread_detach(
pthread_t *thread);
void * pthread_getspecific(
pthread_key_t key);
int pthread_getspecific(
thread_key_t key,
pthread_addr_t
*value);
int pthread_lock_global_np (void);void pthread_lock_
global_np();
int pthread_mutex_init(
pthread_mutex_t
int pthread_mutex_init(
pthread_mutex_t
*mutex,
const pthread_mutexattr_t *attr);
*mutex, pthread_mutexattr_t
attr);
int pthread_attr_setinheritsched(
pthread_attr_t *attr,
int inheritsched);
int pthread_attr_
setinheritsched(
pthread_attr_t *attr,
int inherit);
Table 19 lists the functions that are new in Standard POSIX Threads.
Table 19 New Thread Functions
DescriptionFunction
Declares fork handler routines to be called when the calling
thread's process forks a child process.
pthread_atfork()
Obtains the detachstate attribute of the specified thread
attributes object.
pthread_attr_getdetachstate()
Changes the detachstate attribute in the specified
thread attributes object.
pthread_attr_setdetachstate()
Deletes a thread-specific data key.pthread_key_delete()
Delivers a signal to a specified thread.pthread_kill()
Examines or changes the current thread's signal mask.pthread_sigmask()
Table 20 lists thread functions that have changes to return values only. Errors are returned as status
values, not in errno. Code changes are required if you are porting an existing threaded application
to Standard POSIX Threads.
Table 20 Thread Functions With Changes to Return Values Only
Return Values in Standard POSIX ThreadsFunction
pthread_cancel() 0 = successful
ESRCH Thread not found.
pthread_cond_broadcast() 0 = successful
EINVAL The value cond does not refer to an initialized
condition variable.
pthread_cond_destroy() 0 = successful
EBUSY The implementation has detected an attempt to
destroy the object referenced by cond while it is referenced
by another thread.
Changed Thread Functions 207