summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-07-29 02:59:44 +0000
committerWez Furlong <wez@php.net>2004-07-29 02:59:44 +0000
commitcde7423cde3c8c2c3e28ceb108485a6c67f2bf0a (patch)
tree4dd09505a39b3da287575bedc2ad4b9e9ccfc55e /ext
parentc7f22e5aca1e7e4a8c08a16cbae213e122c2f166 (diff)
downloadphp-git-cde7423cde3c8c2c3e28ceb108485a6c67f2bf0a.tar.gz
Misc. win32 thread safety fixes.
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/basic_functions.c14
-rw-r--r--ext/standard/syslog.c3
2 files changed, 17 insertions, 0 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 6fd7d04915..edb2200a0b 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -35,6 +35,10 @@
#include "ext/standard/dns.h"
#include "ext/standard/php_uuencode.h"
+#ifdef PHP_WIN32
+#include "win32/php_win32_globals.h"
+#endif
+
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#include "zend.h"
@@ -1005,8 +1009,14 @@ PHP_MINIT_FUNCTION(basic)
{
#ifdef ZTS
ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
+#ifdef PHP_WIN32
+ ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, NULL);
+#endif
#else
basic_globals_ctor(&basic_globals TSRMLS_CC);
+#ifdef PHP_WIN32
+ php_win32_core_globals_ctor(&php_win32_core_globals TSRMLS_CC);
+#endif
#endif
REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
@@ -1105,6 +1115,9 @@ PHP_MSHUTDOWN_FUNCTION(basic)
{
#ifdef ZTS
ts_free_id(basic_globals_id);
+#ifdef PHP_WIN32
+ ts_free_id(php_win32_core_globals_id);
+#endif
#else
basic_globals_dtor(&basic_globals TSRMLS_CC);
#endif
@@ -1214,6 +1227,7 @@ PHP_RSHUTDOWN_FUNCTION(basic)
PHP_RSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
PHP_RSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
PHP_RSHUTDOWN(streams)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
+ PHP_RSHUTDOWN(win32_core_globals)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
if (BG(user_tick_functions)) {
zend_llist_destroy(BG(user_tick_functions));
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c
index eeb6849c86..9710ea4d60 100644
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -119,6 +119,9 @@ PHP_RSHUTDOWN_FUNCTION(syslog)
if (BG(syslog_device)) {
efree(BG(syslog_device));
}
+#ifdef PHP_WIN32
+ closelog();
+#endif
return SUCCESS;
}