diff options
author | Zeev Suraski <zeev@php.net> | 1999-04-21 03:49:09 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-04-21 03:49:09 +0000 |
commit | 7a87fcbbdac80f77f8b6ceb16436d398019c6091 (patch) | |
tree | d82be34324646bfc09e3e4ec3e790b45b31986a1 /Zend/zend_constants.c | |
parent | 37fe04b887f84e1a6eff7e356f614d7293aaee58 (diff) | |
download | php-git-7a87fcbbdac80f77f8b6ceb16436d398019c6091.tar.gz |
Thread safety patch. We're still not quite there but it compiles again, and
more logic has been implemented.
Diffstat (limited to 'Zend/zend_constants.c')
-rw-r--r-- | Zend/zend_constants.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 6072227a82..d94574f7cb 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -53,6 +53,8 @@ static int clean_module_constant(zend_constant *c, int *module_number) void clean_module_constants(int module_number) { + ELS_FETCH(); + zend_hash_apply_with_argument(EG(zend_constants), (int (*)(void *,void *)) clean_module_constant, (void *) &module_number); } @@ -65,6 +67,7 @@ int zend_startup_constants(void) DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); #endif + ELS_FETCH(); /* ZEND_FIX: Move to PHP */ @@ -126,6 +129,8 @@ int zend_startup_constants(void) int zend_shutdown_constants(void) { + ELS_FETCH(); + zend_hash_destroy(EG(zend_constants)); free(EG(zend_constants)); return SUCCESS; @@ -134,6 +139,8 @@ int zend_shutdown_constants(void) void clean_non_persistent_constants(void) { + ELS_FETCH(); + zend_hash_apply(EG(zend_constants), (int (*)(void *)) clean_non_persistent_constant); } @@ -192,6 +199,7 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result) zend_constant *c; char *lookup_name = estrndup(name,name_len); int retval; + ELS_FETCH(); zend_str_tolower(lookup_name, name_len); @@ -215,6 +223,7 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result) ZEND_API void zend_register_constant(zend_constant *c) { char *lowercase_name = zend_strndup(c->name, c->name_len); + ELS_FETCH(); #if 0 printf("Registering constant for module %d\n",c->module_number); |