Hi,

As some of you may know, I am working of porting PHP onto NetWare.
I find this in sapi_apache2.c code:

In the "php_post_read_request" function, we register a cleanup
function called "php_server_context_cleanup" to clear clear out
the "SG(server_context)" after each request. We pass the pointer
of this variable to the cleanup function. The comment says that
this is done to cater to those cases where this is handled by
a different thread.

Now, in the "php_server_context_cleanup" function, we just
put this value to NULL.

Now my questions are:

1. Why should we explicitly make SG(server_context) to NULL
at the end of every request? What is the purpose of this operation?
Doesn't this variable get assigned to NULL at the start of each
request?
In that case there is nothing to do in the
"php_server_context_cleanup"
function.

2. If the "php_server_context_cleanup" function is required,
then what is inside this function, isn't this equivalent to making
SG(server_context) = NULL in the "php_server_context_cleanup"
function? If this so, they why pass the pointer of this variable
- why not assign is directly to NULL. Then the
"php_server_context_cleanup"
function looks like this:

        TSRMLS_FETCH();
        SG(server_context) = NULL;

Can you throw some light on this?

Thanks,
Ananth.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to