wxCondition locking
Chris
chrismc911 at hotmail.com
Mon Jan 21 14:09:45 PST 2008
Thanks for your answer!
I have one more question on this: my condition is signalled severals
times during the application run. Do I have to lock the mutex again
once it has been signaled and the waiting thread has been triggered?
Or does the wait call lock the mutex again after the signal has been
triggered? Does the "unlock mutex" after the "send signal" unlock it
in this case?
Thanks,
Chris
On 18 Jan., 16:17, lesnew... at fmail.co.uk (Leslie Newell) wrote:
> Have a look at the example given in the documentation.
>
> in your main thread:
> First create the condition and lock the mutex.
> start the worker thread
> wait() (this implicitly unlocks the mutex)
>
> in your signalling thread
> lock mutex
> send signal
> unlock mutex
>
> Les
>
>
>
> Fabian Cenedese wrote:
> > At 06:26 18.01.2008 -0800, you wrote:
>
> >> Hi, I have a wxCondition with an associated wxMutex. Is it correct to
>
> >> lock mutex
> >> signal condition
> >> unlock mutex
>
> >> and
>
> >> lock mutex
> >> wait on condition
> >> unlock mutex
>
> >> Or is this not the right sequence to make sure no signals are missed?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscr... at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-h... at lists.wxwidgets.org
More information about the wx-users
mailing list