summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-10-16 18:50:19 +0200
committerAnatol Belski <ab@php.net>2014-10-16 18:50:19 +0200
commitaac7b1db7c9df59ffb0860de7692c653719cf4d0 (patch)
tree1fe1bdc2ffc380a0eaeea069ed5cbb0176eb7715 /ext/pdo_mysql
parent073c79b8b539fbbfc540db1cb1a15dfba5358f24 (diff)
downloadphp-git-aac7b1db7c9df59ffb0860de7692c653719cf4d0.tar.gz
converted ext/sqlite and ext/pdo_mysql to use static tsrmls cache
Diffstat (limited to 'ext/pdo_mysql')
-rwxr-xr-xext/pdo_mysql/config.m42
-rw-r--r--ext/pdo_mysql/config.w322
-rw-r--r--ext/pdo_mysql/pdo_mysql.c6
-rw-r--r--ext/pdo_mysql/php_pdo_mysql_int.h5
4 files changed, 12 insertions, 3 deletions
diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4
index f237f413be..95ae6ca7ed 100755
--- a/ext/pdo_mysql/config.m4
+++ b/ext/pdo_mysql/config.m4
@@ -144,7 +144,7 @@ if test "$PHP_PDO_MYSQL" != "no"; then
fi
dnl fix after renaming to pdo_mysql
- PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_cv_inc_path -I)
+ PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_cv_inc_path -I -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
ifdef([PHP_ADD_EXTENSION_DEP],
[
PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
diff --git a/ext/pdo_mysql/config.w32 b/ext/pdo_mysql/config.w32
index da085dc569..f150916b2a 100644
--- a/ext/pdo_mysql/config.w32
+++ b/ext/pdo_mysql/config.w32
@@ -12,7 +12,7 @@ if (PHP_PDO_MYSQL != "no") {
} else {
if (CHECK_LIB("libmysql.lib", "pdo_mysql", PHP_PDO_MYSQL) &&
CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_PDO_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_PDO_MYSQL)) {
- EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c");
+ EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
} else {
WARNING("pdo_mysql not enabled; libraries and headers not found");
}
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
index d9c04470a4..82dbdbc83a 100644
--- a/ext/pdo_mysql/pdo_mysql.c
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -32,6 +32,9 @@
#include "php_pdo_mysql_int.h"
#ifdef COMPILE_DL_PDO_MYSQL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(pdo_mysql)
#endif
@@ -206,6 +209,9 @@ static PHP_RSHUTDOWN_FUNCTION(pdo_mysql)
*/
static PHP_GINIT_FUNCTION(pdo_mysql)
{
+#if defined(COMPILE_DL_PDO_MYSQL) && defined(ZTS)
+ZEND_TSRMLS_CACHE_UPDATE;
+#endif
#ifndef PHP_WIN32
pdo_mysql_globals->default_socket = NULL;
#endif
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
index f6cdb0a8f2..accac8a25e 100644
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -83,7 +83,10 @@ ZEND_END_MODULE_GLOBALS(pdo_mysql)
ZEND_EXTERN_MODULE_GLOBALS(pdo_mysql)
#ifdef ZTS
-#define PDO_MYSQL_G(v) TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
+#define PDO_MYSQL_G(v) ZEND_TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
+# ifdef COMPILE_DL_PDO_MYSQL
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
#define PDO_MYSQL_G(v) (pdo_mysql_globals.v)
#endif