Re: cvs: php4 /ext/midgard midgard.c

From: Date: Thu, 22 Feb 2001 11:42:42 +0000
Subject: Re: cvs: php4 /ext/midgard midgard.c
References: 1 2 3 4 5  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-4209@lists.php.net to get a copy of this message
On Thu, Feb 22, 2001 at 01:38:36PM +0200, Andi Gutmans wrote: > Because thread-wide globals are only available when you're actually in the > thread (during a request) and not when the process starts up. If you need > true globals you can just use globals. sorry - you're right (and i'm stpid:-) forgot about the fact that MINIT is ony called once. you of course have to initialize your globals in your TSRM'ized _ctor funtion like this: static void php_assert_init_globals(ASSERTLS_D) { ASSERT(callback) = 0; } PHP_MINIT_FUNCTION(assert) { #ifdef ZTS assert_globals_id = ts_allocate_id(sizeof(php_assert_globals), (ts_allocate_ctor) php_assert_init_globals, NULL);#else php_assert_init_globals(ASSERTLS_C); #endif <snip> stupid me... tc > > Andi > > At 12:34 PM 2/22/2001 +0100, Thies C. Arntzen wrote: > >On Thu, Feb 22, 2001 at 01:26:45PM +0200, Andi Gutmans wrote: > > > You only have the module globals during requests (rinit/rshutdown). You > > > can't access them in module init/module shutdown. > > > > could you explain why? ok the the midgard PHP_MINIT_FUNCTION > > does not allocate a tsrm_id for the module (which is wrong) > > but apart from that i see no reason why the globals should > > not be available all-time. > > > > tc > > > >-- > >PHP CVS Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: php-cvs-unsubscribe@lists.php.net > >For additional commands, e-mail: php-cvs-help@lists.php.net > >To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-cvs-unsubscribe@lists.php.net > For additional commands, e-mail: php-cvs-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.cvs (#4209) next »