Re: cvs: php4 /main streams.c
| From: | Markus Fischer | Date: | Sun, 26 Aug 2001 10:05:54 +0000 |
| Subject: | Re: cvs: php4 /main streams.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-7076@lists.php.net to get a copy of this message | ||
Is TSRMLS_FETCH the successor of CLS_FETCH()?
- Markus
On Sun, Aug 26, 2001 at 12:39:49PM +0300, Zeev Suraski wrote :
> The thread safety macros pass around a context that the rest of the thread
> safety macros use. There are three types of such macros:
>
> 1. Macros that are used in function declarations, to denote that the
> function accepts this context as an argument:
> TSRMLS_D - if it's the only argument (Thread Safe Resource Manager
> Local Storage, Declaration)
> TSRMLS_DC - if it's not the only argument (Thread Safe Resource
> Manager Local Storage, Declaration with Comma)
>
> 2. Macros that are used in function calls, to pass the context to
> functions that accept it:
> TSRMLS_C - if it's the only argument (Thread Safe Resource Manager
> Local Storage, Call)
> TSRMLS_CC - if it's not the only argument (Thread Safe Resource
> Manager Local Storage, Call with Comma)
>
>
> 3. If the context cannot be passed using function arguments (e.g., in
> certain callbacks), it can be obtained by calling TSRMLS_FETCH() at the
> end of the variable declarations (Thread Safe Resource Manager Local
> Storage Fetch)
>
>
> For performance reasons, using 1+2 is usually preferred to using 3.
>
> Zeev
>
>
>
> At 12:07 26-08-01, Joey Smith wrote:
> >I really don't understand the thread-safety stuff, but shouldn't this
> >also be using TSRMLS_CC instead of TSRMLS_FETCH()?
> >
> >
> >> - TSRMLS_FETCH();
> >> -
> >> /* these names depend on the values of the
> >PHP_STREAM_AS_XXX defines in php_streams.h */
> >> static const char * cast_names[3] = {
> >> "STDIO FILE*", "File Descriptor",
> >> "Socket
> >Descriptor"
> >> };
> >> + TSRMLS_FETCH();
> >> +
> >> zend_error(E_WARNING, "%s(): cannot represent a stream of
> >type %s as a %s",
> >> get_active_function_name(TSRMLS_C),
> >> stream->ops->label,
> >
> >
> >--
> >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
>
> --
> Zeev Suraski <zeev@zend.com>
> CTO & co-founder, Zend Technologies Ltd.
> http://www.zend.com/
>
>
> --
> 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
--
Markus Fischer, http://guru.josefine.at/~mfischer/
EMail: mfischer@guru.josefine.at
PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0
-All your scripts are belong to Zend-