[AD] Fixed small problem with X11 acquire_screen

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


Elias noticed that there was still continuing problems with deadlocks in the GUI, though they were rarer. The backtrace showed that the mouse/timer thread was waiting on an XLOCK/acquire_bitmap while the bg/input thread was waiting on its own XLOCK. I traced the problem to _xwin_lock. I was setting the locked thread id before actually locking the thread, so if a context switch happened at just the right moment when two threads were trying to lock the screen, the program would become confused and deadlock.

I committed a small change, switching lines 143 and 144 of src/x/xvtable.c to set the locked thread id after the thread is locked, which seems to fix the problem.

- Kitty Cat




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