X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eaaa6a06a25774c18d10bb8182cc1934ed0ed9aa..8b6e6947fc8fb946391740d66b140413eccb6b6c:/docs/latex/wx/conditn.tex diff --git a/docs/latex/wx/conditn.tex b/docs/latex/wx/conditn.tex index f6b77506d0..a58d8b5ff4 100644 --- a/docs/latex/wx/conditn.tex +++ b/docs/latex/wx/conditn.tex @@ -1,11 +1,27 @@ \section{\class{wxCondition}}\label{wxcondition} -TODO +wxCondition variables correspond to pthread conditions or to Win32 event +objects. They may be used in a multithreaded application to wait until the +given condition becomes true which happens when the condition becomes signaled. + +For example, if a worker thread is doing some long task and another thread has +to wait until it is finished, the latter thread will wait on the condition +object and the worker thread will signal it on exit (this example is not +perfect because in this particular case it would be much better to just +\helpref{Wait()}{wxthreadwait} for the worker thread, but if there are several +worker threads it already makes much more sense). + +Once the thread(s) are signaled, the condition then resets to the not +signaled state, ready to fire again. \wxheading{Derived from} None. +\wxheading{Include files} + + + \wxheading{See also} \helpref{wxThread}{wxthread}, \helpref{wxMutex}{wxmutex} @@ -38,18 +54,16 @@ Signals the object. \membersection{wxCondition::Wait}\label{wxconditionwait} -\func{void}{Wait}{\param{wxMutex\&}{ mutex}} +\func{void}{Wait}{\void} Waits indefinitely. -\func{bool}{Wait}{\param{wxMutex\&}{ mutex}, \param{unsigned long}{ sec}, \param{unsigned long}{ nsec}} +\func{bool}{Wait}{\param{unsigned long}{ sec}, \param{unsigned long}{ nsec}} Waits until a signal is raised or the timeout has elapsed. \wxheading{Parameters} -\docparam{mutex}{wxMutex object.} - \docparam{sec}{Timeout in seconds} \docparam{nsec}{Timeout nanoseconds component (added to {\it sec}).} @@ -58,4 +72,3 @@ Waits until a signal is raised or the timeout has elapsed. The second form returns if the signal was raised, or FALSE if there was a timeout. -