multithreading problem.



Hi,
  I am writing a multi-threaded application using GTK. Whenever I try to
call a gtk function in a thread I get the following X error:

The program 'a.out' received an X Window System error.
This probably reflects a bug in the program.

 I believe I have followed the instructions given in the FAQ about
multi-threading.

 The thread is being called from a callback function (triggered by a
button). The thread calls a function called show_up() which displays a
dialog (this is where I get the Xerror). Every call to a gtk function in
show_up() is preceeded by threads_enter() and followed by threads_leave().
	I called gthread_init() at the beginning of the program
and the gtk_main() is surrounded by threads_enter(), threads_leave() calls.
	It probably doesn't make any difference but I am using pthreads.

        What am I doing wrong ?

Thanks, Bob.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]