Re: multi-threaded apps.
- From: James Henstridge <james daa com au>
- To: Ian Campbell <ijc25 cam ac uk>
- Cc: gnome-devel-list gnome org
- Subject: Re: multi-threaded apps.
- Date: Fri, 18 Aug 2000 09:37:12 +0800 (WST)
On Thu, 17 Aug 2000, Ian Campbell wrote:
> I am busy checking that Balsa correctly grabs the GDK lock when running with
> threads enabled.
> The FAQ says that Glib callbacks (I/O, idle and timeouts) are called without
> the lock, but that GTK+ callbacks will be called with the lock held.
the gtk lock is not acquired before calling idle, timeout or IO functions
(no matter if you use the gtk or glib APIs).
> I cannot find the point where the lock is grabbed when emitting the GTK+
> So my question is: If I emit a signal in a thread, do I need to grab the lock
> before emmiting the signal?
Well, the gtk_signal_emit function is a gtk function, so you should grab
the lock before calling it. So if you want to emit a signal from an idle
or timeout function, you will need to do GDK_THREADS_ENTER() and
GDK_THREADS_LEAVE() around the gtk calls.
] [Thread Prev