[wx-dev] [ wxwindows-Bugs-1650795 ] wxThread::Wait() never ends
when CreateStatusBar is called
Tim Kosse
tim.kosse at gmx.de
Fri Feb 2 16:51:40 PST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Vadim Zeitlin wrote:
> TK> This is a fine example why wxThread::Wait() is broken. A function with
> TK> implied wait semantics should not process the message queue.
> TK> The current behaviour is similar to the wxYield family of functions and
> TK> those are known to cause lots of interesting problems.
>
> I agree in theory but this particular problem seems to be (I'm sure I'm
> missing something...) to be rather simple to fix: just don't wait for the
> events if we don't dispatch them. I've committed a fix based on this to
> HEAD and will backport it to 2.8 in a slightly different form now.
I've dug up the following discussions:
http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/72013
http://thread.gmane.org/gmane.comp.lib.wxwidgets.general/48370
One argument from the previous discussions I'd still like to comment on:
TK> Would it be possible to add a new parameter to wxThread::Wait, to tell
TK> it not to parse message?
VZ> I guess that we could have such flag which could be used if you're
VZ> absolutely sure that the wait won't take long. Otherwise the only
thing I
VZ> can suggest is to disable the events (wxWindowDisabler) during Wait().
A call to wxThread::Wait() is not much different than for example a call
to wxMutex::Lock(). As developer it is my job to ensure I don't call it
in a way it could cause a significant delay or even a deadlock.
Tim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFw9yc8N9+lcqiUkURAtMmAKCEg5umxAh1fLJSBZaw7/MArMy4VACgmhlD
nbgBL4BySfyFhPjfdn0WZrw=
=53s3
-----END PGP SIGNATURE-----
More information about the wx-dev
mailing list