-Once the thread(s) are signaled, the condition then resets to the not
-signaled state, ready to fire again.
+Note that a call to \helpref{Signal()}{wxconditionsignal} may happen before the
+other thread calls \helpref{Wait()}{wxconditionwait} and, just as with the
+pthread conditions, the signal is then lost and so if you want to be sure to
+get it you must use a mutex together with the condition variable.
+
+\wxheading{Example}
+
+This example shows how a main thread may launch a worker thread which starts
+running and then waits until the main thread signals it to continue:
+
+\begin{verbatim}
+class MyWaitingThread : public wxThread
+{
+public:
+ MyWaitingThread(wxMutex *mutex, wxCondition *condition)
+ {
+ m_mutex = mutex;
+ m_condition = condition;
+
+ Create();
+ }
+
+ virtual ExitCode Entry()
+ {
+ // wait for the signal from the main thread: it is absolutely necessary
+ // to look the mutex before doing it!
+ m_mutex->Lock();
+ m_condition->Signal();
+ m_mutex->Unlock();
+
+ ... do our job ...
+
+ return 0;
+ }
+
+private:
+ wxCondition *m_condition;
+};
+
+int main()
+{
+ wxMutex mutex;
+ wxCondition condition(mutex);
+
+ for ( int i = 0; i < 10; i++ )
+ {
+ MyWaitingThread *thread = new MyWaitingThread(&mutex, &condition);
+
+ thread->Run();
+ }
+
+ // wake up one of the threads
+ condition.Signal();
+
+ // wake up all the other ones
+ condition.Broadcast();
+
+ ... wait until they terminate or do something else ...
+
+ return 0;
+}
+\end{verbatim}