nanogui: GrCheckNextEvent blocks when app linked into server
Subject:
Re: [nanogui] GrCheckNextEvent blocks when app linked into server
From:
Olaf Meeuwissen ####@####.####
Date:
27 Aug 2001 23:29:47 -0000
Message-Id: <87snedytdt.fsf@frodo.epkowa.co.jp>
Jordan Crouse ####@####.#### writes:
> It looks like you just need to add another case to the if statement to
> compensate for the fact that you are esentially calling a select() that
> should return immediately. It seems that GdGetNextTimeout() is not handling
> the edge case of timeout being zero, so you should check for it yourself and
> set the resuting 'to' accordingly:
>
> if (timeout == 0)
> to = 0;
> else if (GdGetNextTimeout(&tout, timeout) == TRUE)
> to = &tout;
> else
> to = NULL;
>
> You could also add code to GdGetNextTimeout() to check for this situation,
> but be careful that you don't break any timer handlers when you do. No time
> should be elapsed from any of the timers for a GrCheckNextEvent() or
> GrPeekEvent() call.
This will also break GrGetNextEvent and GrGetNextEventTimeout. The
problem is that when compiling with -DNONETWORK these two as well as
GrCheckNextEvent eventually call GsSelect with a timeout. However,
for the first two a value of zero means that you want to wait until
there is an event while with GrCheckNextEvent you don't. Because a
timeout value is of unsigned type, there is no way you can fix this
easily in a clean way (without breaking the API spec).
For the time being I've backed out all my mucking around in devtimer.c
and call GrCheckNextEvent with a 1 ms timeout. Blech!
--
Olaf Meeuwissen Epson Kowa Corporation, Research and Development