Permalink
Browse files

Remove request_started, increase thread safety

  • Loading branch information...
1 parent 8696442 commit 94b5119898b13184d501add01208fb0494962209 @zsuraski zsuraski committed Nov 26, 1999
Showing with 9 additions and 9 deletions.
  1. +7 −7 Zend/zend_API.c
  2. +2 −2 Zend/zend_modules.h
View
@@ -735,13 +735,12 @@ void module_destructor(zend_module_entry *module)
clean_module_constants(module->module_number);
}
- if (module->request_started && module->request_shutdown_func) {
+ if (module->request_shutdown_func) {
#if 0
zend_printf("%s: Request shutdown\n",module->name);
#endif
module->request_shutdown_func(module->type, module->module_number);
}
- module->request_started=0;
if (module->module_started && module->module_shutdown_func) {
#if 0
zend_printf("%s: Module shutdown\n",module->name);
@@ -764,13 +763,15 @@ void module_destructor(zend_module_entry *module)
/* call request startup for all modules */
int module_registry_request_startup(zend_module_entry *module)
{
- if (!module->request_started && module->request_startup_func) {
+ if (module->request_startup_func) {
#if 0
zend_printf("%s: Request startup\n",module->name);
#endif
- module->request_startup_func(module->type, module->module_number);
+ if (module->request_startup_func(module->type, module->module_number)==FAILURE) {
+ zend_error(E_WARNING, "request_startup() for %s module failed", module->name);
+ exit(1);
+ }
}
- module->request_started=1;
return 0;
}
@@ -782,13 +783,12 @@ int module_registry_cleanup(zend_module_entry *module)
{
switch(module->type) {
case MODULE_PERSISTENT:
- if (module->request_started && module->request_shutdown_func) {
+ if (module->request_shutdown_func) {
#if 0
zend_printf("%s: Request shutdown\n",module->name);
#endif
module->request_shutdown_func(module->type, module->module_number);
}
- module->request_started=0;
return 0;
break;
case MODULE_TEMPORARY:
View
@@ -27,7 +27,7 @@
#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
-#define STANDARD_MODULE_PROPERTIES_EX 0, 0, 0, NULL, 0
+#define STANDARD_MODULE_PROPERTIES_EX 0, 0, NULL, 0
#define STANDARD_MODULE_PROPERTIES \
NULL, NULL, STANDARD_MODULE_PROPERTIES_EX
@@ -47,7 +47,7 @@ struct _zend_module_entry {
void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
int (*global_startup_func)(void);
int (*global_shutdown_func)(void);
- int request_started, module_started;
+ int module_started;
unsigned char type;
void *handle;
int module_number;

0 comments on commit 94b5119

Please sign in to comment.