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

FreeBSD Manual Pages

  
 
  

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

NAME
     pthread_spin_init,	pthread_spin_destroy --	initialize and destroy a spin-
     lock object

SYNOPSIS
     #include <pthread.h>

     int
     pthread_spin_init(pthread_spinlock_t *lock, int pshared);

     int
     pthread_spin_destroy(pthread_spinlock_t *lock);

DESCRIPTION
     The pthread_spin_init() function creates a	new spinlock object, with
     sharing attributes	specified by pshared.

     The pthread_spin_destroy()	function frees the resources allocated for the
     lock.

RETURN VALUES
     If	successful, pthread_spin_init()	and pthread_spin_destroy() return
     zero; otherwise an	error number is	returned to indicate the error.

ERRORS
     pthread_spin_init() will fail if:

     [EINVAL]		The value specified by lock is invalid.

     [ENOMEM]		The process cannot allocate enough memory to create
			another	spinlock object.

     [ENOTSUP]		The shared attributes specified	by pshared are not
			supported by the current implementation.

     pthread_spin_destroy() will fail if:

     [EINVAL]		The value specified by lock is invalid.

     [EBUSY]		The lock is still in use.

SEE ALSO
     pthread_spin_lock(3), pthread_spin_unlock(3)

STANDARDS
     pthread_spin_init() and pthread_spin_destroy() conform to IEEE Std
     1003.1-2008 ("POSIX.1").

BUGS
     Currently only PTHREAD_PROCESS_PRIVATE spinlocks are supported and	the
     pshared attribute is always set that way.	Any attempts to	initialize it
     to	a different value will trigger ENOTSUP.

FreeBSD	13.0			 April 6, 2020			  FreeBSD 13.0

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

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

home | help