[wx 2.6.3, WinXP] Thread Issues In Console Application
Jul
jul6789 at yahoo.com
Fri Aug 11 14:11:55 PDT 2006
I may have spoken too soon about finding a solution.
The problem I describe here:
--- Jul wrote:
>
> The first problem I noticed was that the joinable
> threads created by my application would occasionally
> get stuck as they were being destroyed (via the
> Destroy method). They would get stuck in an infinite
> loop inside the WaitForTerminate method in the
> wxThreadInternal class. On closer examination, it
> appears that this line of thread.cpp (line 748 in
> the
> msw directory) was the source of the loop:
> ::PostMessage(NULL, WM_NULL, 0, 0);
>
is still occuring. Removing the ::PostMessage didn't
prevent the thread termination from getting stuck
after all.
Does anyone know what
wxConsoleAppTraits::DoMessageFromThreadWait() does? It
always returns true which causes
wxThreadInternal::WaitFotTerminate to fall into an
infinite loop for joinable threads that have
self-terminated (e.g. exited from Entry()).
As an experiment, I've changed
wxConsoleAppTraits::DoMessageFromThreadWait() to
return false instead. Only WaitForTerminate() appears
to use this method. Is there any guidance on whether
or not this is a bad thing to do? In my tests so far,
it seems to fix the stuck thread problem for me.
Thanks,
Jul
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the wx-users
mailing list