[AD] proposal: remove XLOCK/XUNLOCK

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


As was discussed on the AGL list, Allegro's use of XLOCK/XUNLOCK is
problematic when you want to use Allegro together with Mesa, since that
uses X11 commands to implement OpenGL commands, and relies on X11's
internal locking in multithreaded apps.

Therefore, I propose to completely get rid of XLOCK/XUNLOCK.

Consequences would be:

- The signals version would not work with X11 anymore. The X11 port
would require to be multi-threaded. The signals version was only ever
used by one single user though (Vincent), and I think he has long since
switched to the multithreaded version as well, if he still uses
Allegro :)

- Code gets easier to maintain. No more need for all the XLOCK/XUNLOCK
stuff, which is really evil (someone even suggested replacing it by a
"synchronized" construct recently).

- No more need for all the ugly _private functions in xwin.c.

- No async replies with Allegro programs ever again :)

- Mesa (and possible other X11 libraries) can be used with Allegro.


The reason we do not use XInitThreads in the first place was basically
that the XFree86 implementation of XIM I was using when I wrote the XIM
patch was broken, and XLOCK/XUNLOCK already was in place for the signals
version: http://sourceforge.net/mailarchive/message.php?msg_id=9884657

But I just did a test now and defined XLOCK and XUNLOCK both away to
nothing and added XInitThreads() to _xwin_sysdrv_init - and all seems to
work.

Any thoughts?

-- 
Elias Pschernig





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