[svn:PHP-Sandwich] rev 1010 - PHP-Sandwich/trunk/stuff
[email protected] 22 Apr 2005 03:40:37 -0000
| Newsgroups | perl.php.sandwich.dev |
|---|---|
| Message-ID | <[email protected]> |
Author: gschlossnagle Date: Thu Apr 21 20:40:36 2005 New Revision: 1010 Modified: PHP-Sandwich/trunk/stuff/TSRM.patch Log: fix double free Modified: PHP-Sandwich/trunk/stuff/TSRM.patch ============================================================================== --- PHP-Sandwich/trunk/stuff/TSRM.patch (original) +++ PHP-Sandwich/trunk/stuff/TSRM.patch Thu Apr 21 20:40:36 2005 @@ -1,14 +1,14 @@ -Index: TSRM.c +Index: TSRM/TSRM.c =================================================================== RCS file: /repository/TSRM/TSRM.c,v retrieving revision 1.64 -diff -u -p -r1.64 TSRM.c ---- TSRM.c 20 Mar 2005 09:03:40 -0000 1.64 -+++ TSRM.c 8 Apr 2005 16:01:17 -0000 -@@ -379,6 +379,97 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id +diff -u -3 -r1.64 TSRM.c +--- TSRM/TSRM.c 20 Mar 2005 09:03:40 -0000 1.64 ++++ TSRM/TSRM.c 22 Apr 2005 03:39:49 -0000 +@@ -379,6 +379,96 @@ #endif } - + +/* frees and interpreter context. You are responsible for making sure that + * it is not linked into the TSRM hash, and not marked as the current interpreter */ +void tsrm_free_interpreter_context(void *context) @@ -31,7 +31,6 @@ + free(thread_resources); + thread_resources = next; + } -+ free(context); +} + +void *tsrm_set_interpreter_context(void *new_ctx) @@ -100,25 +99,6 @@ + return tsrm_set_interpreter_context(current); +} + - + /* frees all resources allocated for the current thread */ void ts_free_thread(void) -Index: TSRM.h -=================================================================== -RCS file: /repository/TSRM/TSRM.h,v -retrieving revision 1.48 -diff -u -p -r1.48 TSRM.h ---- TSRM.h 17 Mar 2005 08:15:22 -0000 1.48 -+++ TSRM.h 8 Apr 2005 16:01:17 -0000 -@@ -132,6 +132,12 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T m - TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler); - TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler); - -+/* these 3 APIs should only be used by people that fully understand the threading model -+ * used by PHP/Zend and the select SAPI. */ -+TSRM_API void *tsrm_new_interpreter_context(void); -+TSRM_API void *tsrm_set_interpreter_context(void *new_ctx); -+TSRM_API void tsrm_free_interpreter_context(void *context); -+ - #define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1) - #define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1)