Re: updating a GtkTextBuffer from both the app and thread



On Tue, May 27, 2003 at 12:03:31AM +0100, kosh wrote: 
> Now, everything seems to work fine, but sometimes calling
> gdk_threads_enter() causes my application to just "stall".  It usually
> happens when I try to execute a menu option whilst having the debug text
> window open.  But no threads are executing, it still stalls and you
> can't wait until it passes, it's locked up and you can only kill -9 the
> app.
> 
> Anyone got any thoughts?  Anyone who wants to take a look at my code can
> do so, but since I aint got anywhere to put the source, you'll have to
> get an email of it.  But I'd prefer to just get help, rather than waste
> your time looking through my code!

If gdk_threads_enter() somehow gets called twice in a row in the same
thread (including the original/only thread), then you have a deadlock
and the app will lock up.

They are usually fairly simple to debug; run in a debugger and when it
hangs, get a backtrace and you should see the second call to
gdk_threads_enter in the backtrace. Then figure out where the first
call was from that. If you can't, you can also try adding debug spew 
that prints when each enter/leave occurs and see if you get two enter
in a row and where they are. GLib has a #define when compiling it to
enable that for GLib internals, also.

Havoc




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