Re: [AD] Fixed small problem with X11 acquire_screen

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


Chris wrote:


Peter Wang wrote:

Cheers for that. I wanted to look into this but never did. If there are any more problems, what do you think about switching to a recursive mutex instead of XLockDisplay?


I thought XLockDisplay /was/ a mutex?


Yes, it uses pthreads internally.

It behaves exactly like a mutex, except it uses the display as a handle. I'm not quite sure what you mean by recursive mutex, though. You mean like _xwin_[un]lock?

Recursive as in, a thread can lock a mutex that it has already locked as many times as it likes without deadlock. See the PTHREAD_MUTEX_RECURSIVE attribute, which apparently is part of Unix98.

Don't forget, XLockDisplay will also flush the X queue as needed so we don't hit async errors.


Where did you read that it flushed the queue?

Peter




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