Update SAPI modules to interface with the new TSRM.

Enable thread-safety memory debugging in ISAPI when in debug mode
This commit is contained in:
Zeev Suraski 2000-11-18 02:44:04 +00:00
parent 9a0b61a619
commit 030b707296
12 changed files with 13 additions and 12 deletions

View file

@ -652,6 +652,7 @@ static void basic_globals_ctor(BLS_D)
#ifdef TRANS_SID #ifdef TRANS_SID
memset(&BG(url_adapt_state), 0, sizeof(BG(url_adapt_state))); memset(&BG(url_adapt_state), 0, sizeof(BG(url_adapt_state)));
memset(&BG(url_adapt_state_ex), 0, sizeof(BG(url_adapt_state_ex)));
#endif #endif
#ifdef PHP_WIN32 #ifdef PHP_WIN32

View file

@ -605,7 +605,7 @@ int Ns_ModuleInit(char *server, char *module)
{ {
php_ns_context *ctx; php_ns_context *ctx;
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, 0, NULL);
sapi_startup(&sapi_module); sapi_startup(&sapi_module);
sapi_module.startup(&sapi_module); sapi_module.startup(&sapi_module);

View file

@ -589,7 +589,7 @@ CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf,
if (!apache_php_initialized) { if (!apache_php_initialized) {
apache_php_initialized = 1; apache_php_initialized = 1;
#ifdef ZTS #ifdef ZTS
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, 0, NULL);
#endif #endif
sapi_startup(&sapi_module_conf); sapi_startup(&sapi_module_conf);
php_apache_startup(&sapi_module_conf); php_apache_startup(&sapi_module_conf);
@ -708,7 +708,7 @@ void php_init_handler(server_rec *s, pool *p)
if (!apache_php_initialized) { if (!apache_php_initialized) {
apache_php_initialized = 1; apache_php_initialized = 1;
#ifdef ZTS #ifdef ZTS
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, 0, NULL);
#endif #endif
sapi_startup(&sapi_module_conf); sapi_startup(&sapi_module_conf);
php_apache_startup(&sapi_module_conf); php_apache_startup(&sapi_module_conf);

View file

@ -429,7 +429,7 @@ php_apache_server_shutdown(void *tmp)
static void static void
php_apache_server_startup(apr_pool_t *pchild, server_rec *s) php_apache_server_startup(apr_pool_t *pchild, server_rec *s)
{ {
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, 0, NULL);
sapi_startup(&sapi_module); sapi_startup(&sapi_module);
sapi_module.startup(&sapi_module); sapi_module.startup(&sapi_module);
apr_register_cleanup(pchild, NULL, php_apache_server_shutdown, NULL); apr_register_cleanup(pchild, NULL, php_apache_server_shutdown, NULL);

View file

@ -780,7 +780,7 @@ void pike_module_init( void )
{ {
if (!caudium_php_initialized) { if (!caudium_php_initialized) {
#ifdef ZTS #ifdef ZTS
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, 0, NULL);
caudium_globals_id = ts_allocate_id(sizeof(php_caudium_request), NULL, NULL); caudium_globals_id = ts_allocate_id(sizeof(php_caudium_request), NULL, NULL);
#endif #endif
sapi_startup(&sapi_module); sapi_startup(&sapi_module);

View file

@ -409,7 +409,7 @@ int main(int argc, char *argv[])
#endif #endif
#ifdef ZTS #ifdef ZTS
tsrm_startup(1,1,0); tsrm_startup(1,1,0, NULL);
#endif #endif
sapi_startup(&sapi_module); sapi_startup(&sapi_module);

View file

@ -630,7 +630,7 @@ __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, L
{ {
switch (fdwReason) { switch (fdwReason) {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, TSRM_ERROR_LEVEL_CORE, "C:\\TSRM.log");
sapi_startup(&sapi_module); sapi_startup(&sapi_module);
if (sapi_module.startup) { if (sapi_module.startup) {
sapi_module.startup(&sapi_module); sapi_module.startup(&sapi_module);

View file

@ -542,7 +542,7 @@ php4_init(pblock *pb, Session *sn, Request *rq)
{ {
php_core_globals *core_globals; php_core_globals *core_globals;
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, 0, NULL);
core_globals = ts_resource(core_globals_id); core_globals = ts_resource(core_globals_id);
sapi_startup(&sapi_module); sapi_startup(&sapi_module);

View file

@ -283,7 +283,7 @@ int php_doit(PHLS_D SLS_DC)
int pm_init(const char **argv) int pm_init(const char **argv)
{ {
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, 0, NULL);
sapi_startup(&sapi_module); sapi_startup(&sapi_module);
sapi_module.startup(&sapi_module); sapi_module.startup(&sapi_module);

View file

@ -427,7 +427,7 @@ DWORD fnWrapperProc(LPCONTROL_BLOCK lpCB)
} }
BOOL PHP4_startup() { BOOL PHP4_startup() {
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, 0, NULL);
sapi_startup(&sapi_module); sapi_startup(&sapi_module);
if (sapi_module.startup) { if (sapi_module.startup) {
sapi_module.startup(&sapi_module); sapi_module.startup(&sapi_module);

View file

@ -703,7 +703,7 @@ void pike_module_init( void )
{ {
if (!roxen_php_initialized) { if (!roxen_php_initialized) {
#ifdef ZTS #ifdef ZTS
tsrm_startup(1, 1, 0); tsrm_startup(1, 1, 0, NULL);
#ifdef ROXEN_USE_ZTS #ifdef ROXEN_USE_ZTS
roxen_globals_id = ts_allocate_id(sizeof(php_roxen_request), NULL, NULL); roxen_globals_id = ts_allocate_id(sizeof(php_roxen_request), NULL, NULL);
#endif #endif

View file

@ -255,7 +255,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_startup
{ {
#ifdef ZTS #ifdef ZTS
tsrm_startup(1,1,0); tsrm_startup(1, 1, 0, NULL);
#else #else
if (setjmp(EG(bailout))!=0) { if (setjmp(EG(bailout))!=0) {
ThrowServletException(jenv,"bailout"); ThrowServletException(jenv,"bailout");