Re: Is g_log threadsafe?



Hi :),

Quoting Tim Janik (timj gtk org):
> On Mon, 25 Jun 2001, Szymon Polom wrote:

> > While being in a multithreaded application environment I get something like:
> > 
> > conDVD(pid:25505conDVD (pid:25507): LIBCIMDECODERSPU-DEBUG (recursed):
> > write_spu start.
> > aborting...
> > 
> > I assume that g_log is not threadsafe.

> g_log itself is thread safe (or at least supposed to be so, modulo bugs ;)
> but if you attach your own handler you have to make sure it locks all
> strucutres properly that might be used concurrently (even for the same
> handler being run at the same time from different threads).

> the "(recursed)" part above indicates that g_log() was called from within
> a handler of g_log() within the same thread. usually that shouldn't happen
> so we're aborting here.

Ah. I see. I've a handler installed. It's actually a wrapper for the syslog
like debug level types of dot.conf. In this handler I am calling the default
GLIB handler. So i'll do some locking...

Thx...

Bye... SP. 
-- 
Szymon Polom                      | GPG Key-ID 1024D/E6EA36F2
convergence integrated media GmbH | http://www.convergence.de
Rosenthaler Str. 51               | fon: +49(0)30-72 62 06 68 
D-10178 Berlin                    | fax: +49(0)30-72 62 06 55




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