| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- destroy and initialize a barrier object
cc-mt [flag... ]file... [library... ]#include <pthread.h>intpthread_barrier_destroy(pthread_barrier_t *barrier);
intpthread_barrier_init(pthread_barrier_t *barrier,const pthread_barrierattr_t *restrictattr,unsignedcount);
Thepthread_barrier_destroy() function destroys the barrier referenced bybarrier and releases anyresources used by the barrier. The effect of subsequent use of thebarrier is undefined until the barrier is reinitialized by another call topthread_barrier_init(). An implementation can use this function to set barrier to aninvalid value. The results are undefined ifpthread_barrier_destroy() is called when anythread is blocked on the barrier, or if this function is calledwith an uninitialized barrier.
Thepthread_barrier_init() function allocates any resources required to use the barrier referencedby barrier and initializes the barrier with attributes referenced byattr. Ifattr isNULL, the default barrier attributes are used; the effect is thesame as passing the address of a default barrier attributes object. Theresults are undefined ifpthread_barrier_init() is called when any thread is blockedon the barrier (that is, has not returned from thepthread_barrier_wait(3C) call).The results are undefined if a barrier is used without first beinginitialized. The results are undefined ifpthread_barrier_init() is called specifying an already initializedbarrier.
Thecount argument specifies the number of threads that must callpthread_barrier_wait()before any of them successfully return from the call. The value specifiedbycount must be greater than 0.
If thepthread_barrier_init() function fails, the barrier is not initialized and thecontents ofbarrier are undefined.
Only the object referenced by barrier can be used for performing synchronization.The result of referring to copies of that object in calls topthread_barrier_destroy() orpthread_barrier_wait() is undefined.
Upon successful completion, these functions returns 0. Otherwise, an error number isreturned to indicate the error.
Thepthread_barrier_init() function will fail if:
The system lacks the necessary resources to initialize another barrier.
The value specified bycount is equal to 0.
Insufficient memory exists to initialize the barrier.
Thepthread_barrier_init() function may fail if:
The implementation has detected an attempt to destroy a barrier while it is in use (for example, while being used in apthread_barrier_wait() call) by another thread.
The value specified byattr is invalid.
Thepthread_barrier_destroy() function may fail if:
The implementation has detected an attempt to destroy a barrier while it is in use (for example, while being used in apthread_barrier_wait() call) by another thread.
The value specified bybarrier is invalid.
Seeattributes(5) for descriptions of the following attributes:
|
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |