Re: [AD] Fixed small problem with X11 acquire_screen

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


Peter Wang wrote:
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.

Oh, okay. The _xwin_lock and _xwin_unlock functions do exactly that.

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?

Based on my experiences, it seems that XLockDisplay will flush the queue, as needed, with context switches. Remember the problems with the test program's blitting performance when you don't yield/rest? It's because a seperate thread couldn't get in a lock and allow X to properly flush the queue. Whether or not the lock function itself does it, I don't know. Though if we do recursive locking via _xwin_[un]lock, it shouldn't be a problem.

- Kitty Cat




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