On Nov 6, 2008, at 20:52, Tiago Vignatti wrote:

Hey,

Jeremy Huddleston escreveu:
Looks good! A recent bug report has surfaced for us since I got rid of the locking in mieqProcessInputEvents. We need to update miEventQueue.tail only after the data has actually been pushed into the tail. This should take care of that problem on master, but I haven't tested it:

Well, it won't be a problem with Xorg input thread because mieqEnqueue is tread-safe. There's a mutex protecting writes to the tail pointer in that function and xquartz will need it as well.

Well the problem was that mieqProcessInputEvents DOESN'T use those locks, so it can read the incremented value of miEventQueue.tail thinking that the item at head=tail-1 is ready to read when in fact mieqEnqueue is still in the process of writing to it.

Further, mieqEnqueue sometimes edits miEventQueue.tail-1 (when the current and tail-1 events are MotionNotify)... but mieqProcessInputEvents is already reading it.

For this reason, I went back to locking inside mieqProcessInputEvents with XQUARTZ.

--Jeremy

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to