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: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to