Re: [AD] Non C program accessing Allegro on OS X

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]



Peter Hull wrote:


On Wednesday, October 26, 2005, at 03:24  am, Jon Rafkind wrote:

While hacking the crap out of the OS X code I discovered that a Bus error would occur if rest(1) was called while the usleep( 100000 / refresh_rate ) happened. Im about to goto sleep and dont have to to investigate it now but does it sound like that might be a race condition?


Rest ends up calling usleep anyway; I don't see why calling usleep in 2 threads can be a race condition. Please let me know what you find!

Actually I dont think theres a problem with rest, it was crashing for other reasons.

Regarding your first problem, it is as Elias says. The complication is that events only get delivered to thread 1* so the event handler must be in thread 1, with your code in thread 2. Other threads are used for timers and audio.

I think Im a little confused as to the sequence of events on OS X.
Is it a)
OS X main
osx_bootstrap_ok --> sets up OSX port or something
call user main
user main
allegro_init
start new thread for OS X handling code

Or is it b)
OS X main
start new thread for OS X handling code
osx_bootrap_ok
call user main
user main
allegro_init

I mean at what point does the OS X code get called? I tried calling the OS X setup code by hand but this doesnt work. I think things would work if the OS X init code occured somewhere during install_allegro, no?




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/