First post from an X newbie - so please go easy on me :)
There's quite
a few recent bug reports around looking similar to this (subject line).
I
know because I had this occur in our own multi threaded app and have been
searching for a solution. (No luck.)
So I figured out that the only way
this assert could occur is if _XAllocID was being called without
LockDisplay() in effect. So I added an assert in XAllocID to try and find
the offending caller:
if( dpy->lock & font-family: "Courier New";
mso-no-proof: yes;"> assert( pthread_mutex_lock(dpy->lock->mutex) ==
EDEADLK );
Then re-ran the app - and hit the assert from
OurFn()-->XShmAttach() -->_XAllocID ()
libXext::XShmAttach looks like
this...
Status XShmAttach(Display *dpy, XShmSegmentInfo *shminfo)
{
...
shminfo->shmseg = XAllocID(dpy);
LockDisplay(dpy);
... some
stuff ...
UnlockDisplay(dpy);
SyncHandle();
return 1;
}
Is
this a bug in XShmAttach? Should LockDisplay() be moved before the
XAllocId() line...?
Or is it the XShmAttach caller's responsibility to lock
the display?
I made and tested a patch with LockDisplay moved before
XAllocID and it definitely fixed our problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/xcb/attachments/20091008/f1b9b65f/attachment.html