Hello,

On 4/27/05, Mishael A Sibiryakov <[EMAIL PROTECTED]> wrote:
> Hi.
>
> I have a multi-threaded application and sometimes i have to receive this
> message: Xlib: unexpected async reply (sequence 0x46dea)!
>
> I try to search in google but is says that is threads problem. Please
> tell me what caused this problem and how i can resolve it ?

   The actual cause of the problem lies in your code, so no one can
give you any clue without looking at it. But the general solution is
that if you are making any gtk/gdk calls from more than one thread,
you should put some locks on those calls. One method of achieving that
that i use (and which I think is most-widely/standard one) is:

1. Inititialize the Gdk threads in the beginning of your program by
calling gdk_threads_init ().

2. Call gdk_threads_enter () before and gdk_threads_leave () after
each of the gtk/gdk calls you make in your threads.

> PS: I don't use g_* threads, i use pthread_*.

   I don't think that will make any difference.

Regards,

Zeeshan Ali.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to