PTHREAD_CONDATTR(3) | MidnightBSD Library Functions Manual | PTHREAD_CONDATTR(3) |
pthread_condattr_init
,
pthread_condattr_destroy
,
pthread_condattr_getclock
,
pthread_condattr_setclock
,
pthread_condattr_getpshared
,
pthread_condattr_setpshared
—
condition attribute operations
POSIX Threads Library (libpthread, -lpthread)
#include
<pthread.h>
int
pthread_condattr_init
(pthread_condattr_t
*attr);
int
pthread_condattr_destroy
(pthread_condattr_t
*attr);
int
pthread_condattr_getclock
(pthread_condattr_t
* restrict attr, clockid_t * restrict
clock_id);
int
pthread_condattr_setclock
(pthread_condattr_t
*attr, clockid_t
clock_id);
int
pthread_condattr_getpshared
(pthread_condattr_t
* restrict attr, int * restrict pshared);
int
pthread_condattr_setpshared
(pthread_condattr_t
*attr, int
pshared);
Condition attribute objects are used to specify parameters to
pthread_cond_init
().
The
pthread_condattr_init
()
function initializes a condition attribute object with the default
attributes.
The
pthread_condattr_destroy
()
function destroys a condition attribute object.
The
pthread_condattr_getclock
()
function will put the value of the clock attribute from
attr into the memory area pointed to by
clock_id. The
pthread_condattr_setclock
()
function will set the clock attribute of attr to the
value specified in clock_id. The clock attribute
affects the interpretation of abstime in
pthread_cond_timedwait(3)
and may be set to CLOCK_REALTIME
(default) or
CLOCK_MONOTONIC
.
PTHREAD_PROCESS_PRIVATE
PTHREAD_PROCESS_SHARED
If successful, these functions return 0. Otherwise, an error number is returned to indicate the error.
The pthread_condattr_init
() function will
fail if:
ENOMEM
]The pthread_condattr_destroy
() function
will fail if:
EINVAL
]The pthread_condattr_setclock
() function
will fail if:
EINVAL
]The pthread_condattr_setpshared
() function
will fail if:
EINVAL
]The pthread_condattr_init
() and
pthread_condattr_destroy
() functions conform to
ISO/IEC 9945-1:1996 (“POSIX.1”)
May 31, 2016 | midnightbsd-3.1 |