WaitEvent() locks application (linux) with fix

Archives Forums/BlitzMax Bug Reports/WaitEvent() locks application (linux) with fix

explosive(Posted 2012) [#1]
Hello everybody,

The function WaitEvents() locks the application for exactly 10 seconds on linux (opensuse 12.1, 3.1.9-1.4-desktop, i686, 32Bit).

Fix works as follows:
Change line 270 in "brl.mod/system.mod/system.linux.c" from
tv.tv_sec=10;

to
tv.tv_sec=0;


Recompile module. Performance of app is now as expected, CPU load still perfectly low.

Maybe someone likes to check the fix on other distros.

Regards, Simon


marksibly(Posted 2012) [#2]
Hi,

WaitEvents? Do you mean WaitEvent?

WaitEvent is meant to suspend execution until something is posted to the event queue.

Anyway, this works here on Arch Linux:

Import maxgui.drivers

CreateWindow "Test!",0,0,640,480

While WaitEvent()<>EVENT_WINDOWCLOSE
    Print CurrentEvent.ToString()
Wend


...sizing the window causes 'size' events, and closing the window exits immediately.