summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-04-21 17:28:54 +0000
committerZeev Suraski <zeev@php.net>1999-04-21 17:28:54 +0000
commit7aad23132703ae2ab35b9faf1bc955af8376e03e (patch)
tree812302a2cff847519b05a468d3f811ce6c68e449
parenta9f9ae792030e99b6552ff9090cc8e808d148fc1 (diff)
downloadphp-git-7aad23132703ae2ab35b9faf1bc955af8376e03e.tar.gz
Thread safety patch. It works now with just-in-time resource initialization!
-rw-r--r--ext/standard/basic_functions.c5
-rw-r--r--ext/standard/syslog.c2
-rw-r--r--main/configuration-parser.y3
-rw-r--r--main/main.c2
-rw-r--r--main/php_ini.c3
-rw-r--r--php4ts.dsw6
-rw-r--r--testfunc2
7 files changed, 15 insertions, 8 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 1417a87126..bf0a5da21a 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -374,7 +374,7 @@ void test_class_startup();
int php3_minit_basic(INIT_FUNC_ARGS)
{
- TLS_VARS;
+ ELS_FETCH();
REGISTER_DOUBLE_CONSTANT("M_PI", M_PI, CONST_CS | CONST_PERSISTENT);
test_class_startup();
@@ -2088,6 +2088,7 @@ PHP_FUNCTION(define)
pval *var, *val, *non_cs;
int case_sensitive;
zend_constant c;
+ ELS_FETCH();
switch(ARG_COUNT(ht)) {
case 2:
@@ -2128,7 +2129,7 @@ PHP_FUNCTION(define)
c.flags = case_sensitive | ~CONST_PERSISTENT; /* non persistent */
c.name = php3_strndup(var->value.str.val, var->value.str.len);
c.name_len = var->value.str.len+1;
- zend_register_constant(&c);
+ zend_register_constant(&c ELS_CC);
RETURN_TRUE;
}
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c
index 4581ed58dc..662aa08cfb 100644
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -57,7 +57,7 @@ static void start_syslog(void);
int php3_minit_syslog(INIT_FUNC_ARGS)
{
- TLS_VARS;
+ ELS_FETCH();
/* error levels */
REGISTER_LONG_CONSTANT("LOG_EMERG", LOG_EMERG, CONST_CS | CONST_PERSISTENT); /* system unusable */
diff --git a/main/configuration-parser.y b/main/configuration-parser.y
index f89987b63b..b54079d6e0 100644
--- a/main/configuration-parser.y
+++ b/main/configuration-parser.y
@@ -167,6 +167,7 @@ int php3_init_config(void)
{
char *env_location,*default_location,*php_ini_path;
int safe_mode_state = PG(safe_mode);
+ char *open_basedir = PG(open_basedir);
char *opened_path;
int free_default_location=0;
@@ -209,12 +210,14 @@ int php3_init_config(void)
strcpy(php_ini_path,default_location);
}
PG(safe_mode) = 0;
+ PG(open_basedir) = NULL;
cfgin = php3_fopen_with_path("php3.ini","r",php_ini_path,&opened_path);
free(php_ini_path);
if (free_default_location) {
free(default_location);
}
PG(safe_mode) = safe_mode_state;
+ PG(open_basedir) = open_basedir;
if (!cfgin) {
# if WIN32|WINNT
diff --git a/main/main.c b/main/main.c
index db7f3f7a41..b46b261b8a 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1199,7 +1199,7 @@ static void php3_parse(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC)
if (setjmp(EG(bailout))!=0) {
return;
}
- _php3_hash_environment();
+ _php3_hash_environment(PLS_C);
#if WIN32||WINNT
UpdateIniFromRegistry(primary_file->filename);
diff --git a/main/php_ini.c b/main/php_ini.c
index 406f5ac79b..a58c0ba9d9 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -105,6 +105,9 @@ int php_register_ini_entries(php_ini_entry *ini_entry, int module_number)
php_unregister_ini_entries(module_number);
return FAILURE;
}
+ if (hashed_ini_entry->on_modify) {
+ hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg);
+ }
if ((default_value=cfg_get_entry(p->name, p->name_length))) {
if (!hashed_ini_entry->on_modify
|| hashed_ini_entry->on_modify(hashed_ini_entry, default_value->value.str.val, default_value->value.str.len, hashed_ini_entry->mh_arg)==SUCCESS) {
diff --git a/php4ts.dsw b/php4ts.dsw
index c198b2017a..0cd8ad1862 100644
--- a/php4ts.dsw
+++ b/php4ts.dsw
@@ -23,9 +23,6 @@ Package=<5>
Package=<4>
{{{
- Begin Project Dependency
- Project_Dep_Name TSRM
- End Project Dependency
}}}
###############################################################################
@@ -41,6 +38,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name libzendts
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name TSRM
+ End Project Dependency
}}}
###############################################################################
diff --git a/testfunc b/testfunc
index cb55a66a6f..6c4775e54f 100644
--- a/testfunc
+++ b/testfunc
@@ -16,7 +16,7 @@ function bar()
foo();
}
-for ($i=0; $i<100000; $i++) {
+for ($i=0; $i<1000; $i++) {
bar();
}