Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PTHREAD_CONDATTR_IN... FreeBSD Library Functions Manual	PTHREAD_CONDATTR_IN...

NAME
     pthread_condattr_init, pthread_condattr_destroy,
     pthread_condattr_setclock,	pthread_condattr_getclock -- condition vari-
     able attribute operations

SYNOPSIS
     #include <pthread.h>

     int
     pthread_condattr_init(pthread_condattr_t *attr);

     int
     pthread_condattr_destroy(pthread_condattr_t *attr);

     int
     pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id);

     int
     pthread_condattr_getclock(pthread_condattr_t *attr, clockid_t *clock_id);

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

     The pthread_condattr_init() function initializes attr with	all the	de-
     fault condition variable attributes.

     The pthread_condattr_destroy() function destroys attr.

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

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

ERRORS
     pthread_condattr_init() will fail if:

     [ENOMEM]		Out of memory.

     pthread_condattr_setclock() will fail if:

     [EINVAL]		The value of clock_id is neither CLOCK_REALTIME	nor
			CLOCK_MONOTONIC.

SEE ALSO
     clock_gettime(2), pthread_cond_init(3)

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

FreeBSD	13.0			 June 5, 2013			  FreeBSD 13.0

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO | STANDARDS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=pthread_condattr_init&sektion=3&manpath=OpenBSD+6.9>

home | help