pthread_attr_setscope(PTHREAD)
pthread_attr_setscope, pthread_attr_getscope --
set and get contentionscope attribute
Synopsis
cc [options] -Kthread file
#include <pthread.h>
int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope);
int pthread_attr_getscope(const pthread_attr_t *attr,
int *contentionscope);
Description
pthread_attr_setscope
and
pthread_attr_getscope
are used to set and get the
contentionscope
attribute in the
attr
object.
contentionscope
may have the values
PTHREAD_SCOPE_SYSTEM,
signifying system scheduling contention scope,
or PTHREAD_SCOPE_PROCESS,
signifying process scheduling contention scope.
The symbols PTHREAD_SCOPE_SYSTEM and PTHREAD_SCOPE_PROCESS
are defined by the header
pthread.h
Usage
After these attributes have been set, a thread can be created with
the specified attributes using
pthread_create(PTHREAD).
Using these routines does not affect the current running thread.
Return values
If successful,
pthread_attr_setscope
and
pthread_attr_getscope
return zero.
Otherwise, an error number is returned to indicate the error.
Diagnostics
If the following condition is detected,
pthread_attr_setscope
and
pthread_attr_getscope
will return the corresponding value:
EINVAL-
invalid attribute
If the follwing condition is detected,
pthread_attr_setscope
will return the corresponding value:
ENOTSUP-
attempt to set the attribute to an unsupported value
References
pthread_attr_init(PTHREAD),
pthread_attr_setinheritsched(PTHREAD),
pthread_attr_setschedpolicy(PTHREAD),
pthread_attr_setschedparam(PTHREAD),
pthread_create(PTHREAD),
pthread_setschedparam(PTHREAD),
pthread(F),
sched(F)
Standards compliance
The Single UNIX Specification, Version 2; The Open Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005