Re: [AD] proposal: remove XLOCK/XUNLOCK

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


On Sun, 2006-04-23 at 12:05 -0700, Chris wrote:
> On Sunday 23 April 2006 09:19, Elias Pschernig wrote:
> > But the problem just is, XLOCK/XUNLOCK is inherently error prone, and
> > since as you found out, x.org already calls XLockDisplay/XUnlockDisplay
> > where it needs it, is not needed at all.
> 
> However, just like with bitmap/screen locking, it'd be useful to do it 
> manually just once for a group of commands instead of letting each command 
> lock itself.

Not sure. A mutex should be a pretty lightweight operation.

> Plus, can we gaurantee X will always lock for us? Is it in any 
> official documentation? Can we assume it'll always be this way even for other 
> implementations (eg. XGL or AIGLX)?
> 

Yes, true. If XLockDisplay actually is needed, then we can't remove
XLOCK/XUNLOCK. But to me it looks like "XLockDisplay" or something else
is always called by X11, and in case XInitThreads was not called, it
does the check for "async reply", otherwise it uses a pthreads mutex.

-- 
Elias Pschernig





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