Re: some improvements to gmodule-win32 and gthread-win32



 --- muppet <scott asofyet org> a écrit : > 
> carpentier benoît said:
> > in g_thread_impl_init () :
> > is it useful to have :
> > static gboolean beenhere = FALSE;
> > ...
> > if (beenhere)
> > return;
> >
> > beenhere = TRUE;
> >
> > why not having initialiszd beenhere to TRUE
> directly ?
> 
> Because otherwise it wouldn't work.  The "static" is
> very important --- that
> means that this variable will hold its value through
> all invocations of the
> function; the initialization to FALSE happens at
> program startup time
> (actually, at compile time, i believe).  This code
> basically means, by default
> we have not been here; the first time we run through
> it, we will set the flag,
> and on all subsequent invocations we will bail out
> early.

Hello,
Thanks for your explanation, I think I understand this
now.

Benoît Carpentier


	

	
		
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com



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