Skip to content

Commit

Permalink
Remove request_started, increase thread safety
Browse files Browse the repository at this point in the history
  • Loading branch information
zsuraski committed Nov 26, 1999
1 parent 8696442 commit 94b5119
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions Zend/zend_API.c
Expand Up @@ -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);
Expand All @@ -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;
}

Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_modules.h
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 94b5119

Please sign in to comment.