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

FreeBSD Manual Pages

  
 
  

home | help
PTHREAD_CONDATTR(3)    FreeBSD Library Functions Manual	   PTHREAD_CONDATTR(3)

NAME
     pthread_condattr_init, pthread_condattr_destroy,
     pthread_condattr_getclock,	pthread_condattr_setclock,
     pthread_condattr_getpshared, pthread_condattr_setpshared -- condition at-
     tribute operations

LIBRARY
     POSIX Threads Library (libpthread,	-lpthread)

SYNOPSIS
     #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);

DESCRIPTION
     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 in-
     terpretation of abstime in	pthread_cond_timedwait(3) and may be set to
     CLOCK_REALTIME (default) or CLOCK_MONOTONIC.

     The pthread_condattr_getpshared() function	will put the value of the
     process-shared attribute from attr	into the memory	area pointed to	by
     pshared.  The pthread_condattr_setpshared() function will set the
     process-shared attribute of attr to the value specified in	pshared.  The
     argument pshared may have one of the following values:

     PTHREAD_PROCESS_PRIVATE  The condition variable it	is attached to may
			      only be accessed by threads in the same process
			      as the one that created the object.

     PTHREAD_PROCESS_SHARED   The condition variable it	is attached to may be
			      accessed by threads in processes other than the
			      one that created the object.

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

ERRORS
     The pthread_condattr_init() function will fail if:

     [ENOMEM]		Out of memory.

     The pthread_condattr_destroy() function will fail if:

     [EINVAL]		Invalid	value for attr.

     The pthread_condattr_setclock() function will fail	if:

     [EINVAL]		The value specified in clock_id	is not one of the al-
			lowed values.

     The pthread_condattr_setpshared() function	will fail if:

     [EINVAL]		The value specified in pshared is not one of the al-
			lowed values.

SEE ALSO
     pthread_cond_init(3), pthread_cond_timedwait(3)

STANDARDS
     The pthread_condattr_init() and pthread_condattr_destroy()	functions con-
     form to ISO/IEC 9945-1:1996 ("POSIX.1")

FreeBSD	13.0			 May 31, 2016			  FreeBSD 13.0

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

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=pthread_condattr_destroy&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help