I have encountered a deadlock using directfb and gtk+. The bug is in
directfb. Repeatedly moving mouse across window boundary in gtk+ app
invoke this deadlock. The exact interaction is as follows:

Mouse Thread:
1) Mouse events in mouse thread acquire a windowstack lock during
dispatch of mouse event. They then make a write call on queue the
message for delivery.

Foreground/App Thread:
2) GTK+ is listening for mouse events. On receiving mouse event that
crosses window boundary it wants to change cursor shape. It then
invokes the appropriate IDirectFBChangeCursorShape call that in turn
wants to acquire a windowstack lock before changing the cursor shape.

I can understand why the windowstack lock is being acquired. On
deadlock, Mouse thread is in write call - blocked since the buffer is
full. The buffer is full since the app thread is waiting to acquire a
windowstack lock [before it does cursor change shape] and hence can't
empty the buffer. The buffer for socketpair is limited in size
[usually 64k] and hence the deadlock.

Any suggestion on a fix ?

Kalpak


Reply via email to