1 \section{\class{wxCondition
}}\label{wxcondition
}
3 wxCondition variables correspond to pthread conditions or to Win32 event
4 objects. They may be used in a multithreaded application to wait until the
5 given condition becomes true which happens when the condition becomes signaled.
7 For example, if a worker thread is doing some long task and another thread has
8 to wait until it's finished, the latter thread will wait on the condition
9 object and the worker thread will signal it on exit (this example is not
10 perfect because in this particular case it would be much better to just
11 \helpref{Wait()
}{wxthreadwait
} for the worker thread, but if there are several
12 worker threads it already makes much more sense).
14 \wxheading{Derived from
}
18 \wxheading{Include files
}
24 \helpref{wxThread
}{wxthread
},
\helpref{wxMutex
}{wxmutex
}
26 \latexignore{\rtfignore{\wxheading{Members
}}}
28 \membersection{wxCondition::wxCondition
}\label{wxconditionconstr
}
30 \func{}{wxCondition
}{\void}
34 \membersection{wxCondition::
\destruct{wxCondition
}}
36 \func{}{\destruct{wxCondition
}}{\void}
38 Destroys the wxCondition object.
40 \membersection{wxCondition::Broadcast
}\label{wxconditionbroadcast
}
42 \func{void
}{Broadcast
}{\void}
44 Broadcasts to all waiting objects.
46 \membersection{wxCondition::Signal
}\label{wxconditionsignal
}
48 \func{void
}{Signal
}{\void}
52 \membersection{wxCondition::Wait
}\label{wxconditionwait
}
54 \func{void
}{Wait
}{\param{wxMutex\&
}{ mutex
}}
58 \func{bool
}{Wait
}{\param{wxMutex\&
}{ mutex
},
\param{unsigned long
}{ sec
},
\param{unsigned long
}{ nsec
}}
60 Waits until a signal is raised or the timeout has elapsed.
62 \wxheading{Parameters
}
64 \docparam{mutex
}{wxMutex object.
}
66 \docparam{sec
}{Timeout in seconds
}
68 \docparam{nsec
}{Timeout nanoseconds component (added to
{\it sec
}).
}
70 \wxheading{Return value
}
72 The second form returns if the signal was raised, or FALSE if there was a timeout.