diff options
author | Sterling Hughes <sterling@php.net> | 2003-04-27 21:57:07 +0000 |
---|---|---|
committer | Sterling Hughes <sterling@php.net> | 2003-04-27 21:57:07 +0000 |
commit | a294f9b2d14cdee24123e57cda497abc356203ec (patch) | |
tree | 6903747660a2020ad861ce7b7b58a193ceddfc36 /TSRM/TSRM.h | |
parent | 8820a9cdcc4aafe47e266ff4e34026d948a50ba6 (diff) | |
download | php-git-a294f9b2d14cdee24123e57cda497abc356203ec.tar.gz |
add TSRMLS_FETCH_CTX which allows you to map a variable to a ts context.
This is useful when you are mapping callbacks, you can simply associate
a struct member to a thread context:
void mycallback(my_struct *user) {
TSRMLS_FETCH_CTX(user->thread_ctx);
}
Diffstat (limited to 'TSRM/TSRM.h')
-rw-r--r-- | TSRM/TSRM.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index 0fcd5c221a..888d5ff78b 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -149,6 +149,7 @@ TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread #define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1) #define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL) +#define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx #define TSRMG(id, type, element) (((type) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) #define TSRMLS_D void ***tsrm_ls #define TSRMLS_DC , TSRMLS_D |