?? pthread_cond_broadcast.txt
字號:
--------------------------------------------------------------------------------AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1--------------------------------------------------------------------------------pthread_cond_signal or pthread_cond_broadcast SubroutinePurposeUnblocks one or more threads blocked on a condition.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_cond_signal (condition)pthread_cond_t *condition;int pthread_cond_broadcast (condition)pthread_cond_t *condition;DescriptionThese subroutines unblock one or more threads blocked on the condition specifiedby condition. The pthread_cond_signal subroutine unblocks at least one blockedthread, while the pthread_cond_broadcast subroutine unblocks all the blockedthreads.If more than one thread is blocked on a condition variable, the scheduling policydetermines the order in which threads are unblocked. When each thread unblockedas a result of a pthread_cond_signal or pthread_cond_broadcast returns from itscall to pthread_cond_wait or pthread_cond_timedwait, the thread owns the mutexwith which it called pthread_cond_waitor pthread_cond_timedwait. The thread(s)that are unblocked contend for the mutex according to the scheduling policy (ifapplicable), and as if each had called pthread_mutex_lock.The pthread_cond_signal or pthread_cond_broadcast functions may be called by athread whether or not it currently owns the mutex that threads callingpthread_cond_wait or pthread_cond_timedwait have associated with the conditionvariable during their waits; however, if predictable scheduling behaviour isrequired, then that mutex is locked by the thread calling pthread_cond_signal orpthread_cond_broadcast.If no thread is blocked on the condition, the subroutine succeeds, but thesignalling of the condition is not held. The next thread callingpthread_cond_wait will be blocked. Note: The pthread.h header file must be the first included file of each source file using the threads library. Otherwise, the -D_THREAD_SAFE compilation flag should be used, or the cc_r compiler used. In this case, the flag is automatically set.Parametercondition Specifies the condition to signal.Return ValuesUpon successful completion, 0 is returned. Otherwise, an error code is returned.Error CodeThe pthread_cond_signal and pthread_cond_broadcast subroutines are unsuccessfulif the following is true:EINVAL The condition parameter is not valid.Implementation SpecificsThese subroutines are part of the Base Operating System (BOS) Runtime.Related InformationThe pthread_cond_wait or pthread_cond_timedwait subroutine.Using Condition Variables in AIX Version 4.3 General Programming Concepts:Writing and Debugging Programs.Threads Library Quick Reference in AIX Version 4.3 General Programming Concepts:Writing and Debugging Programs.--------------------------------------------------------------------------------
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -