OpenBSD manual page server

Manual Page Search Parameters


pthread_condattr_init, pthread_condattr_destroy, pthread_condattr_setclock, pthread_condattr_getclockcondition variable attribute operations

#include <pthread.h>

pthread_condattr_init(pthread_condattr_t *attr);

pthread_condattr_destroy(pthread_condattr_t *attr);

pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id);

pthread_condattr_getclock(pthread_condattr_t *attr, clockid_t *clock_id);

Condition variable attributes are used to specify parameters to (). One attribute object can be used in multiple calls to pthread_cond_init(), with or without modifications between calls.

The () function initializes attr with all the default condition variable attributes.

The () function destroys attr.

The () function sets the clock attribute of attr to the value of the clock_id parameter. The () function copies the value of the clock attribute from attr to the location pointed to by the clock_id parameter. The clock attribute is the ID of the clock against which the timeout of () is compared; the default value of the clock attribute is CLOCK_REALTIME.

If successful, these functions return 0. Otherwise, an error number is returned to indicate the error.

pthread_condattr_init() will fail if:

Out of memory.

pthread_condattr_setclock() will fail if:

The value of clock_id is neither CLOCK_REALTIME nor CLOCK_MONOTONIC.

clock_gettime(2), pthread_cond_init(3)

pthread_condattr_init(), pthread_condattr_destroy(), pthread_condattr_setclock(), and pthread_condattr_getclock() conform to IEEE Std 1003.1-2008 (“POSIX.1”)

June 5, 2013 OpenBSD-current