summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/apache/apache.c3
-rw-r--r--ext/bcmath/number.c3
-rw-r--r--ext/dbase/dbase.c3
-rw-r--r--ext/ereg/ereg.c4
-rw-r--r--ext/filepro/filepro.c4
-rw-r--r--ext/gd/gd.c4
-rw-r--r--ext/imap/imap.h3
-rw-r--r--ext/informix/ifx.ec6
-rw-r--r--ext/ldap/ldap.c9
-rw-r--r--ext/msql/msql.c3
-rw-r--r--ext/standard/base64.c3
-rw-r--r--ext/standard/basic_functions.c4
-rw-r--r--ext/standard/browscap.c3
-rw-r--r--ext/standard/datetime.c3
-rw-r--r--ext/standard/dir.c3
-rw-r--r--ext/standard/dl.c3
-rw-r--r--ext/standard/dns.c3
-rw-r--r--ext/standard/exec.c3
-rw-r--r--ext/standard/file.c3
-rw-r--r--ext/standard/filestat.c4
-rw-r--r--ext/standard/formatted_print.c3
-rw-r--r--ext/standard/fsock.c4
-rw-r--r--ext/standard/head.c4
-rw-r--r--ext/standard/html.c3
-rw-r--r--ext/standard/info.c4
-rw-r--r--ext/standard/link.c4
-rw-r--r--ext/standard/mail.c3
-rw-r--r--ext/standard/math.c3
-rw-r--r--ext/standard/md5.c3
-rw-r--r--ext/standard/microtime.c3
-rw-r--r--ext/standard/mime.c4
-rw-r--r--ext/standard/pack.c4
-rw-r--r--ext/standard/pageinfo.c4
-rw-r--r--ext/standard/post.c4
-rw-r--r--ext/standard/reg.c4
-rw-r--r--ext/standard/string.c4
-rw-r--r--ext/standard/syslog.c4
-rw-r--r--ext/standard/uniqid.c4
-rw-r--r--ext/standard/url.c3
-rw-r--r--ext/standard/var.c3
-rw-r--r--ext/zlib/zlib.c3
-rw-r--r--fhttpd.c3
-rw-r--r--main/fopen_wrappers.c4
-rw-r--r--main/main.c3
-rw-r--r--main/safe_mode.c4
-rw-r--r--mod_php3.c5
-rw-r--r--php3_realpath.c4
-rw-r--r--request_info.c3
-rw-r--r--tls.c113
-rw-r--r--tls.h207
-rw-r--r--win32/pwd.c3
-rw-r--r--win32/sendmail.c3
-rw-r--r--win32/time.c4
-rw-r--r--win32/winutil.c12
-rw-r--r--win32/wsyslog.c3
55 files changed, 21 insertions, 499 deletions
diff --git a/ext/apache/apache.c b/ext/apache/apache.c
index 1c7f9de43e..e3129a36f7 100644
--- a/ext/apache/apache.c
+++ b/ext/apache/apache.c
@@ -30,9 +30,6 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "ext/standard/head.h"
#include "php_globals.h"
diff --git a/ext/bcmath/number.c b/ext/bcmath/number.c
index 868c629aac..fbacf5bc67 100644
--- a/ext/bcmath/number.c
+++ b/ext/bcmath/number.c
@@ -55,9 +55,6 @@
*************************************************************************/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#if 0
#include "bcdefs.h"
#include "proto.h"
diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c
index 46b1162583..cd9ba2e8ad 100644
--- a/ext/dbase/dbase.c
+++ b/ext/dbase/dbase.c
@@ -30,9 +30,6 @@
#include "dl/phpdl.h"
#endif
-#if defined(THREAD_SAFE)
-#include "tls.h"
-#endif
#include <stdlib.h>
#include "php.h"
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index 8b81e82e7f..4f37bf133a 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -29,9 +29,7 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include <stdio.h>
#include "php.h"
#include "php3_string.h"
diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c
index ab055fc442..6935530d35 100644
--- a/ext/filepro/filepro.c
+++ b/ext/filepro/filepro.c
@@ -33,9 +33,7 @@
web site at http://www.fileproplus.com/
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include "safe_mode.h"
#include "fopen-wrappers.h"
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 884908db12..d0f0f9db22 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -35,9 +35,7 @@
Cold Spring Harbor Labs. */
/* Note that there is no code from the gd package in this file */
-#ifdef THREAD_SAFE
-# include "tls.h"
-#endif
+
#include "php.h"
#include "ext/standard/head.h"
#include <math.h>
diff --git a/ext/imap/imap.h b/ext/imap/imap.h
index 421ca5e76e..56c75ad743 100644
--- a/ext/imap/imap.h
+++ b/ext/imap/imap.h
@@ -8,9 +8,6 @@
#if HAVE_IMAP
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#ifndef MSVC5
#include "build-defs.h"
#endif
diff --git a/ext/informix/ifx.ec b/ext/informix/ifx.ec
index 519045d369..2f6ce79675 100644
--- a/ext/informix/ifx.ec
+++ b/ext/informix/ifx.ec
@@ -101,12 +101,6 @@ Changes 12.11.1998 (danny.heijl@cevi.be)
#if defined(COMPILE_DL)
#include "dl/phpdl.h"
#endif
-#if defined(THREAD_SAFE)
-#include "tls.h"
-DWORD InformixTls;
-static int numthreads=0;
-void *ifx_mutex;
-#endif
#if WIN32|WINNT
#include <winsock.h>
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 85207f9629..f85b0dcf7c 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -32,15 +32,6 @@
/* $Id$ */
#define IS_EXT_MODULE
-#if !PHP_31 && defined(THREAD_SAFE)
-#undef THREAD_SAFE
-#endif
-#ifdef THREAD_SAFE
-#include "tls.h"
-DWORD ldapTLS;
-static int numthreads=0;
-void *ldap_mutex;
-#endif
#include "php.h"
diff --git a/ext/msql/msql.c b/ext/msql/msql.c
index dbeb4c7f38..acf687174b 100644
--- a/ext/msql/msql.c
+++ b/ext/msql/msql.c
@@ -28,9 +28,6 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#if COMPILE_DL
diff --git a/ext/standard/base64.c b/ext/standard/base64.c
index 392f2451ac..3099934764 100644
--- a/ext/standard/base64.c
+++ b/ext/standard/base64.c
@@ -28,9 +28,6 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include <string.h>
#include "php.h"
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index e2865ac83f..92d3d6bcff 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -30,9 +30,7 @@
#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? (p)->value.obj.properties : NULL)))
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include "php_ini.h"
#include "internal_functions_registry.h"
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 4045a698a1..3fe1500708 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -27,9 +27,6 @@
+----------------------------------------------------------------------+
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "php3_browscap.h"
#include "php_ini.h"
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index 191371a8c2..3c0cf138b0 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -33,9 +33,6 @@
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "zend_operators.h"
#include "datetime.h"
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 1edd10d374..546f31554b 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -29,9 +29,6 @@
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "fopen-wrappers.h"
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index e10ba466c1..60ae23c2d6 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -29,9 +29,6 @@
+----------------------------------------------------------------------+
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "dl.h"
#include "php_globals.h"
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 5a338856d0..2bec92bb88 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -30,9 +30,6 @@
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index af35ae131e..c4ea465c86 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -28,9 +28,6 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include <stdio.h>
#include "php.h"
#include <ctype.h>
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 86e499e28f..5e34d73795 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -27,9 +27,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "php_globals.h"
#include "ext/standard/flock_compat.h"
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 98a6156353..bd539e1d5d 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -28,9 +28,7 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include "safe_mode.h"
#include "fopen-wrappers.h"
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 956f0071fd..4efb949292 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -30,9 +30,6 @@
/* $Id$ */
#include <math.h> /* modf() */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "ext/standard/head.h"
#include "php3_string.h"
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 6e210281cf..c699136ceb 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -28,9 +28,7 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include <stdlib.h>
#if HAVE_UNISTD_H
diff --git a/ext/standard/head.c b/ext/standard/head.c
index 70429bee34..6c2772a547 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -27,9 +27,7 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include <stdio.h>
#include "php.h"
#include "ext/standard/php3_standard.h"
diff --git a/ext/standard/html.c b/ext/standard/html.c
index f15131523d..49baf94b41 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -28,9 +28,6 @@
+----------------------------------------------------------------------+
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "reg.h"
#include "html.h"
diff --git a/ext/standard/info.c b/ext/standard/info.c
index b6e5ac26fc..cfcf15a06c 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -27,9 +27,7 @@
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include "php_ini.h"
#include "php_globals.h"
diff --git a/ext/standard/link.c b/ext/standard/link.c
index 57af8dbe87..6cf79471f4 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -29,9 +29,7 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include "php3_filestat.h"
#include "php_globals.h"
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 685e8d9cf9..af6820a869 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -33,9 +33,6 @@
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#ifndef MSVC5
#include "build-defs.h"
diff --git a/ext/standard/math.c b/ext/standard/math.c
index e13fb82119..eb427941eb 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -28,9 +28,6 @@
+----------------------------------------------------------------------+
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "phpmath.h"
#include "snprintf.h"
diff --git a/ext/standard/md5.c b/ext/standard/md5.c
index 23e2d54c4b..959b7dea9a 100644
--- a/ext/standard/md5.c
+++ b/ext/standard/md5.c
@@ -30,9 +30,6 @@
/*
* md5.c - Copyright 1997 Lachlan Roche
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include <stdio.h>
#include "php.h"
diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c
index 3ccf2a28a9..81e0694a58 100644
--- a/ext/standard/microtime.c
+++ b/ext/standard/microtime.c
@@ -36,9 +36,6 @@
#include <string.h>
#include <errno.h>
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "microtime.h"
#include "snprintf.h"
diff --git a/ext/standard/mime.c b/ext/standard/mime.c
index fdc794a87c..d6f71e57ac 100644
--- a/ext/standard/mime.c
+++ b/ext/standard/mime.c
@@ -27,9 +27,7 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include <stdio.h>
#include "php.h"
#include "ext/standard/php3_standard.h"
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index 83fa1284d5..b6dfd1f5eb 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -27,9 +27,7 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include <stdio.h>
diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c
index 2c072c7b35..18ef5df956 100644
--- a/ext/standard/pageinfo.c
+++ b/ext/standard/pageinfo.c
@@ -27,9 +27,7 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include "pageinfo.h"
diff --git a/ext/standard/post.c b/ext/standard/post.c
index 224450990d..3520c0b3b1 100644
--- a/ext/standard/post.c
+++ b/ext/standard/post.c
@@ -27,9 +27,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include <stdio.h>
#include "php.h"
#include "php3_standard.h"
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index 8b81e82e7f..4f37bf133a 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -29,9 +29,7 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include <stdio.h>
#include "php.h"
#include "php3_string.h"
diff --git a/ext/standard/string.c b/ext/standard/string.c
index b05605275c..973081f02f 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -31,9 +31,7 @@
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include <stdio.h>
#include "php.h"
#include "reg.h"
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c
index 662aa08cfb..e1cdae36e4 100644
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -28,9 +28,7 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include "php_ini.h"
#include "zend_globals.h"
diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c
index 89988b3eca..548838fdf9 100644
--- a/ext/standard/uniqid.c
+++ b/ext/standard/uniqid.c
@@ -28,9 +28,7 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include <stdlib.h>
diff --git a/ext/standard/url.c b/ext/standard/url.c
index df6e6171f6..4cd32961ea 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -34,9 +34,6 @@
#include <sys/types.h>
/* php.h includes the correct regex.h */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include "url.h"
diff --git a/ext/standard/var.c b/ext/standard/var.c
index feb277c4c3..7bf00519f5 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -27,9 +27,6 @@
+----------------------------------------------------------------------+
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 363bfed9b0..46ff513c56 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -28,9 +28,6 @@
#endif
#define IS_EXT_MODULE
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include <stdio.h>
diff --git a/fhttpd.c b/fhttpd.c
index 46d7551b27..8069ea3d71 100644
--- a/fhttpd.c
+++ b/fhttpd.c
@@ -28,9 +28,6 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#include <stdlib.h>
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 60edb6fae4..74823b2945 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -29,10 +29,6 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
-
#include "php.h"
#include "php_globals.h"
diff --git a/main/main.c b/main/main.c
index 65fab070b1..5a0cf38eef 100644
--- a/main/main.c
+++ b/main/main.c
@@ -36,9 +36,6 @@
#undef SHUTDOWN_DEBUG
#define SHUTDOWN_DEBUG(resource)
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include <stdio.h>
#include "php.h"
#ifdef MSVC5
diff --git a/main/safe_mode.c b/main/safe_mode.c
index 1b96bdf7dd..c4992893a9 100644
--- a/main/safe_mode.c
+++ b/main/safe_mode.c
@@ -27,9 +27,7 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "php.h"
#include <stdio.h>
diff --git a/mod_php3.c b/mod_php3.c
index 4fb46433d5..46febce3fb 100644
--- a/mod_php3.c
+++ b/mod_php3.c
@@ -30,10 +30,6 @@
*/
/* $Id$ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#include "php.h"
-#else
#include "httpd.h"
#include "http_config.h"
#if MODULE_MAGIC_NUMBER > 19980712
@@ -48,7 +44,6 @@
#include "http_protocol.h"
#include "http_request.h"
#include "http_log.h"
-#endif
/* These are taken out of php_ini.h
diff --git a/php3_realpath.c b/php3_realpath.c
index 44ef3f9a23..6132ef8c91 100644
--- a/php3_realpath.c
+++ b/php3_realpath.c
@@ -27,10 +27,6 @@
+----------------------------------------------------------------------+
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
-
#include "php.h"
#if HAVE_UNISTD_H
diff --git a/request_info.c b/request_info.c
index d760284a73..330599f1da 100644
--- a/request_info.c
+++ b/request_info.c
@@ -27,9 +27,6 @@
+----------------------------------------------------------------------+
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h"
#ifndef THREAD_SAFE
diff --git a/tls.c b/tls.c
deleted file mode 100644
index 9b6155392a..0000000000
--- a/tls.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP HTML Embedded Scripting Language Version 3.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
- +----------------------------------------------------------------------+
- | This program is free software; you can redistribute it and/or modify |
- | it under the terms of one of the following licenses: |
- | |
- | A) the GNU General Public License as published by the Free Software |
- | Foundation; either version 2 of the License, or (at your option) |
- | any later version. |
- | |
- | B) the PHP License as published by the PHP Development Team and |
- | included in the distribution in the file: LICENSE |
- | |
- | This program is distributed in the hope that it will be useful, |
- | but WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- | GNU General Public License for more details. |
- | |
- | You should have received a copy of both licenses referred to here. |
- | If you did not, or have any questions about PHP licensing, please |
- | contact core@php.net. |
- +----------------------------------------------------------------------+
- | Authors: |
- | |
- +----------------------------------------------------------------------+
- */
-#include "tls.h"
-
-#if THREAD_SAFE
-/*This is indeed a global!*/
-DWORD TlsIndex;
-#else
-php3_globals_struct *php3_globals;
-#endif
-
-/* just copying from some samples, can replace this with
-standard php error messaging */
-VOID ErrorExit (LPTSTR lpszMessage)
-{
- fprintf(stderr, "%s\n", lpszMessage);
- ExitProcess(0);
-}
-
-/*all these functions are called from DllMain()
- in a NON thread safe version, tls_startup and
- tls_shutdown should be initiated before anything
- else. This will allocate memory for globals.
-
- called at dll load*/
-int tls_startup(void){
-#if THREAD_SAFE
- if ((TlsIndex=TlsAlloc())==0xFFFFFFFF){
- return 0;
- }
-#else
- php3_globals=malloc(sizeof(php3_globals));
-#endif
- return 1;
-}
-/*called at dll unload*/
-int tls_shutdown(void){
-#if THREAD_SAFE
- if (!TlsFree(TlsIndex)){
- return 0;
- }
-#else
- free(php3_globals);
-#endif
- return 1;
-}
-
-#if THREAD_SAFE
-/*called at start of thread*/
-int tls_create(void){
- php3_globals_struct *php3_globals;
- php3_globals = (php3_globals_struct *) LocalAlloc(LPTR, sizeof(php3_globals_struct));
- if (! TlsSetValue(TlsIndex, (void *) php3_globals))
- ErrorExit("TlsSetValue error");
-
- return 1;
-}
-
-/*called at end of thread*/
-int tls_destroy(void){
- php3_globals_struct *php3_globals;
- php3_globals = TlsGetValue(TlsIndex);
- if (php3_globals != 0)
- LocalFree((HLOCAL) php3_globals);
- return 1;
-}
-
-#endif
-
-
-/*
-accessing data inside a thread
-This short function shows how the global struct
-is accessed in a function. THREAD_SAFE should
-only need to be defined on windows server modules
-
-void thread_safe_access_of_globals(VOID)
-{
- TLS_VARS;
-
- if ((php3_globals == 0) && (GetLastError() != 0)) {
- ErrorExit("TlsGetValue error");
- }
-}
-
-*/
diff --git a/tls.h b/tls.h
deleted file mode 100644
index c401d1448c..0000000000
--- a/tls.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP HTML Embedded Scripting Language Version 3.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
- +----------------------------------------------------------------------+
- | This program is free software; you can redistribute it and/or modify |
- | it under the terms of one of the following licenses: |
- | |
- | A) the GNU General Public License as published by the Free Software |
- | Foundation; either version 2 of the License, or (at your option) |
- | any later version. |
- | |
- | B) the PHP License as published by the PHP Development Team and |
- | included in the distribution in the file: LICENSE |
- | |
- | This program is distributed in the hope that it will be useful, |
- | but WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- | GNU General Public License for more details. |
- | |
- | You should have received a copy of both licenses referred to here. |
- | If you did not, or have any questions about PHP licensing, please |
- | contact core@php.net. |
- +----------------------------------------------------------------------+
- | Authors: |
- | |
- +----------------------------------------------------------------------+
- */
-#ifndef _TLS_H_
-#define _TLS_H_
-#if WIN32|WINNT
-#include "win32/pwd.h"
-#include "win32/sendmail.h"
-#include <winsock.h>
-#endif
-
-#include "alloc.h"
-#include "ext/standard/head.h"
-#include "ext/bcmath/number.h"
-#include "constants.h"
-#include <sys/stat.h>
-#if USE_SAPI
-#include "serverapi/sapi.h"
-#endif
-
-typedef struct php3_global_struct{
- /*all globals must be here*/
- /*alloc.c*/
- void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
- unsigned char cache_count[MAX_CACHED_MEMORY];
- int saved_umask;
- mem_header *head;
- unsigned int allocated_memory;
-
- /*getopt.c*/
- char *optarg;
- int optind;
- int opterr;
- int optopt;
- /*file.c*/
- int pclose_ret;
- int wsa_fp;
- /*zend-parser.tab.c*/
- HashTable function_table;
- HashTable include_names;
- int current_lineno;
- int include_count;
- FunctionState function_state;
- FunctionState php3g_function_state_for_require;
- char *class_name;
- HashTable *class_symbol_table;
- pval return_value,globals;
- unsigned int param_index;
- pval *array_ptr;
- /*list.c*/
- int module_count;
- int current_module_being_cleaned;
- /*main.c*/
- int initialized;
- int module_initialized;
- char *php3_ini_path;
- unsigned char header_is_being_sent;
-#if APACHE
- request_rec *php3_rqst;
-#endif
-#if USE_SAPI
- struct sapi_request_info *sapi_rqst;
-#endif
-#if WIN32|WINNT
- unsigned int wintimer_counter;
- unsigned int wintimer;
- unsigned int timerstart;
-#endif
- FILE *phpin;
- /*request_info.c*/
- php3_request_info request_info;
- /*token_cache.c*/
- pval phplval;
- /*constants.c*/
- HashTable php3_constants;
-
- /*Functions*/
- /*bc math*/
- long bc_precision;
- bc_num _zero_;
- bc_num _one_;
- bc_num _two_;
- /*browscap.c*/
- HashTable browser_hash;
- char *lookup_browser_name;
- pval *found_browser_entry;
- /*dir.c*/
- int dirp_id;
- int le_dirp;
- /*file.c*/
- int fgetss_state;
- int le_fp;
- int le_pp;
- /*filestat.c*/
- char *CurrentStatFile;
-#if MSVC5
- unsigned int CurrentStatLength;
-#else
- int CurrentStatLength;
-#endif
- struct stat sb;
-#if HAVE_SYMLINK
- struct stat lsb;
-#endif
- /*formated_print.c*/
- char cvt_buf[80]; /*STATIC VAR*/
- /*head.c*/
- int php3_PrintHeader;
- CookieList *top;
- char *cont_type;
- int header_called;
- /*info.c*/
-#if APACHE
- module *top_module;
-#endif
- /*pageinfo.c*/
- long page_uid;
- long page_inode;
- long page_mtime;
- /*post.c*/
- int le_uploads;
- /*strings.h*/
- char *strtok_string;
- char *strtok_pos1; /*STATIC VAR*/
- char *strtok_pos2; /*STATIC VAR*/
-#ifndef HAVE_STRERROR
- char str_ebuf[40]; /*STATIC VAR*/
-#endif
-#if WIN32|WINNT
- /*pwd.c*/
- struct passwd pw; /* should we return a malloc()'d structure */
- /*sendmail.c*/
- char Buffer[MAIL_BUFFER_SIZE];
- SOCKET sc;
- WSADATA Data;
- struct hostent *adr;
- SOCKADDR_IN sock_in;
- int WinsockStarted;
- char *AppName;
- char MailHost[HOST_NAME_LEN];
- char LocalHost[HOST_NAME_LEN];
- /*winsyslog.c*/
- char *loghdr; /* log file header string */
- HANDLE loghdl; /* handle of event source */
- /*time.c*/
- unsigned int proftimer,virttimer,realtimer;
- LPMSG phpmsg;
- /*winutil*/
- char Win_Error_msg[256];
-#endif
- /*check for each module if it is compiled staticly
- we should include their globals here.*/
-} php3_globals_struct;
-
-#ifdef THREAD_SAFE
-extern DWORD TlsIndex;
-
-extern int tls_create(void);
-extern int tls_destroy(void);
-
-/* these are from the flex scanner */
-#ifndef YY_TLS_VARS
-#define phptext php_gbl->text
-#define phpleng php_gbl->leng
-extern DWORD phpLexTlsIndex;
-#define YY_TLS_VARS flex_globals *php_gbl = TlsGetValue(phpLexTlsIndex)
-#endif
-
-/* Other needed defines */
-#if !defined(COMPILE_DL)
-extern int phplex(pval *phplval, struct php3_global_struct *php3_globals, flex_globals *php_gbl);
-#endif
-#else
-extern php3_globals_struct *php3_globals;
-
-#endif
-
-extern int tls_startup(void);
-extern int tls_shutdown(void);
-
-#endif
diff --git a/win32/pwd.c b/win32/pwd.c
index e6d709d750..27194a7874 100644
--- a/win32/pwd.c
+++ b/win32/pwd.c
@@ -23,9 +23,6 @@
much useful things under MS-DOS, but using them avoids many "#ifdef
MSDOS" in ported UN*X code ... */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h" /*php specific */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
diff --git a/win32/sendmail.c b/win32/sendmail.c
index b598a03b9c..2889676a90 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -18,9 +18,6 @@
*
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h" /*php specific */
#include <stdio.h>
#include <stdlib.h>
diff --git a/win32/time.c b/win32/time.c
index 1a50f87547..c48315e3e4 100644
--- a/win32/time.c
+++ b/win32/time.c
@@ -13,9 +13,7 @@
/* Include stuff ************************************************************ */
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
+
#include "time.h"
#include "unistd.h"
#include "signal.h"
diff --git a/win32/winutil.c b/win32/winutil.c
index 0ac7e54703..d22aa308dc 100644
--- a/win32/winutil.c
+++ b/win32/winutil.c
@@ -1,9 +1,3 @@
-#ifdef THREAD_SAFE
-#include "tls.h"
-#else
-#define TLS_VARS
-#define GLOBAL(a) a
-#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "winutil.h"
@@ -14,16 +8,14 @@ static char Win_Error_msg[256];
char *php3_win_err(void)
{
- TLS_VARS;
-
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR) GLOBAL(Win_Error_msg),
+ (LPTSTR) Win_Error_msg,
256,
NULL);
- return GLOBAL(Win_Error_msg);
+ return Win_Error_msg;
}
diff --git a/win32/wsyslog.c b/win32/wsyslog.c
index 4207370dbf..701eeed913 100644
--- a/win32/wsyslog.c
+++ b/win32/wsyslog.c
@@ -50,9 +50,6 @@
* Lift a leg, Yunie. Luv ya forever!!!!
*/
-#ifdef THREAD_SAFE
-#include "tls.h"
-#endif
#include "php.h" /*php specific */
#include "syslog.h"
#include <stdio.h>