]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/conditn.tex
Commented out deprecated classes: wxProp and wxTab classes; moved some chapters
[wxWidgets.git] / docs / latex / wx / conditn.tex
... / ...
CommitLineData
1\section{\class{wxCondition}}\label{wxcondition}
2
3wxCondition variables correspond to pthread conditions or to Win32 event
4objects. They may be used in a multithreaded application to wait until the
5given condition becomes true which happens when the condition becomes signaled.
6
7For example, if a worker thread is doing some long task and another thread has
8to wait until it is finished, the latter thread will wait on the condition
9object and the worker thread will signal it on exit (this example is not
10perfect 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
12worker threads it already makes much more sense).
13
14Once the thread(s) are signaled, the condition then resets to the not
15signaled state, ready to fire again.
16
17\wxheading{Derived from}
18
19None.
20
21\wxheading{Include files}
22
23<wx/thread.h>
24
25\wxheading{See also}
26
27\helpref{wxThread}{wxthread}, \helpref{wxMutex}{wxmutex}
28
29\latexignore{\rtfignore{\wxheading{Members}}}
30
31\membersection{wxCondition::wxCondition}\label{wxconditionconstr}
32
33\func{}{wxCondition}{\void}
34
35Default constructor.
36
37\membersection{wxCondition::\destruct{wxCondition}}
38
39\func{}{\destruct{wxCondition}}{\void}
40
41Destroys the wxCondition object.
42
43\membersection{wxCondition::Broadcast}\label{wxconditionbroadcast}
44
45\func{void}{Broadcast}{\void}
46
47Broadcasts to all waiting objects.
48
49\membersection{wxCondition::Signal}\label{wxconditionsignal}
50
51\func{void}{Signal}{\void}
52
53Signals the object.
54
55\membersection{wxCondition::Wait}\label{wxconditionwait}
56
57\func{void}{Wait}{\void}
58
59Waits indefinitely.
60
61\func{bool}{Wait}{\param{unsigned long}{ sec}, \param{unsigned long}{ nsec}}
62
63Waits until a signal is raised or the timeout has elapsed.
64
65\wxheading{Parameters}
66
67\docparam{sec}{Timeout in seconds}
68
69\docparam{nsec}{Timeout nanoseconds component (added to {\it sec}).}
70
71\wxheading{Return value}
72
73The second form returns if the signal was raised, or FALSE if there was a timeout.
74