wxLin message queue freezing for >60s
Volker Bartheld
dr_versaeg at freenet.de
Mon Feb 18 02:55:19 PST 2008
Hi!
>On a LINUX (wxLin2.8.6) system I have evidence that sometimes, when a
>worker thread sends a notification to the main thread's class derived from
>wxApp (using a custom event that was created via DEFINE_EVENT_TYPE) the
>whole wxWidgets event system freezes for around a minute (or even more),
>then continues with just that custom event and all the other that might
>have accumulated.
The thing cleared up meanwhile. It was a wrong use of the select() command:
bool Server::DataAvailable(long tv_sec)
{
fd_set fdset={1, m_Sock};
timeval timeout={tv_sec, 0};
return select(m_Sock+1, &fdset, NULL, NULL,
LONG_MAX==tv_sec?NULL:&timeout)>0;
}
instead of
bool Server::DataAvailable(long tv_sec)
{
fd_set fdset;
FD_ZERO(&fdset);
FD_SET(m_Sock, &fdset);
timeval timeout={tv_sec, 0};
return select(m_Sock+1, &fdset, NULL, NULL,
LONG_MAX==tv_sec?NULL:&timeout)>0;
}
HTH,
V.
--
mailto: V B A R T H E L D at G M X dot D E
More information about the wx-users
mailing list