andrey Tue Jan 29 18:11:46 2008 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/mysqlndphp_mysqlnd.c
Modified files:
/php-src/ext/mysqlndconfig9.m4 mysqlnd.c mysqlnd.h
mysqlnd_result.c mysqlnd_result.h
mysqlnd_structs.h
Log:
Fix the build, add a missing file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/config9.m4?r1=1.3.2.5r2=1.3.2.6diff_format=u
Index: php-src/ext/mysqlnd/config9.m4
diff -u php-src/ext/mysqlnd/config9.m4:1.3.2.5
php-src/ext/mysqlnd/config9.m4:1.3.2.6
--- php-src/ext/mysqlnd/config9.m4:1.3.2.5 Mon Jan 28 23:23:08 2008
+++ php-src/ext/mysqlnd/config9.m4 Tue Jan 29 18:11:46 2008
@@ -1,7 +1,12 @@
dnl
-dnl $Id: config9.m4,v 1.3.2.5 2008/01/28 23:23:08 andrey Exp $
+dnl $Id: config9.m4,v 1.3.2.6 2008/01/29 18:11:46 andrey Exp $
dnl config.m4 for mysqlnd driver
+
+PHP_ARG_ENABLE(mysqlnd_threading, whether to enable threaded fetch in mysqlnd,
+[ --enable-mysqlnd-threading mysqlnd: Enable threaded fetch], no, no)
+
+
dnl If some extension uses mysqlnd it will get compiled in PHP core
if test $PHP_MYSQLND_ENABLED = yes; then
mysqlnd_sources=mysqlnd.c mysqlnd_charset.c mysqlnd_wireprotocol.c \
@@ -16,6 +21,13 @@
PHP_INSTALL_HEADERS([$ext_builddir/php_mysqlnd_config.h])
AC_DEFINE([HAVE_MYSQLND], 1, [Whether mysqlnd is enabled])
+ dnl Windows uses config.w32 thus this code is safe for now
+ if test $PHP_MYSQLND_THREADING = yes; then
+PHP_BUILD_THREAD_SAFE
+AC_DEFINE([MYSQLND_THREADED], 1, [Whether mysqlnd threading is enabled])
+ fi
+
+
dnl This creates a file so it has to be after above macros
PHP_CHECK_TYPES([int8 uint8 int16 uint16 int32 uint32 uchar ulong int8_t
uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t], [
$ext_builddir/php_mysqlnd_config.h
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.5.2.12r2=1.5.2.13diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd.c
diff -u php-src/ext/mysqlnd/mysqlnd.c:1.5.2.12
php-src/ext/mysqlnd/mysqlnd.c:1.5.2.13
--- php-src/ext/mysqlnd/mysqlnd.c:1.5.2.12 Tue Jan 29 11:59:53 2008
+++ php-src/ext/mysqlnd/mysqlnd.c Tue Jan 29 18:11:46 2008
@@ -18,7 +18,7 @@
+--+
*/
-/* $Id: mysqlnd.c,v 1.5.2.12 2008/01/29 11:59:53 andrey Exp $ */
+/* $Id: mysqlnd.c,v 1.5.2.13 2008/01/29 18:11:46 andrey Exp $ */
#include php.h
#include mysqlnd.h
#include mysqlnd_wireprotocol.h
@@ -68,63 +68,6 @@
static enum_func_status mysqlnd_send_close(MYSQLND * conn TSRMLS_DC);
-#define MYSQLND_SILENT 1
-
-#ifdef MYSQLND_THREADED
-/* {{{ _mysqlnd_fetch_thread */
-void * _mysqlnd_fetch_thread(void *arg)
-{
- MYSQLND *conn = (MYSQLND *) arg;
- MYSQLND_RES * result = NULL;
- void ***tsrm_ls = conn-tsrm_ls;
-#ifndef MYSQLND_SILENT
- printf(conn=%p tsrm_ls=%p\n, conn, conn-tsrm_ls);
-#endif
- do {
- pthread_mutex_lock(conn-LOCK_work);
- while (conn-thread_killed == FALSE /* there is work */) {
-#ifndef MYSQLND_SILENT
- printf(Waiting for work in %s\n, __FUNCTION__);
-#endif
- pthread_cond_wait(conn-COND_work, conn-LOCK_work);
- }
- if (conn-thread_killed == TRUE) {
-#ifndef MYSQLND_SILENT
- printf(Thread killed in %s\n, __FUNCTION__);
-#endif
- pthread_cond_signal(conn-COND_thread_ended);
- pthread_mutex_unlock(conn-LOCK_work);
- break;
- }
-#ifndef MYSQLND_SILENT
- printf(Got work in %s\n, __FUNCTION__);
-#endif
- CONN_SET_STATE(conn, CONN_FETCHING_DATA);
- result = conn-current_result;
- conn-current_result = NULL;
- pthread_mutex_unlock(conn-LOCK_work);
-
- mysqlnd_background_store_result_fetch_data(result TSRMLS_CC);
-
- /* do fetch the data from the wire */
-
- pthread_mutex_lock(conn-LOCK_work);
- CONN_SET_STATE(conn, CONN_READY);
- pthread_cond_signal(conn-COND_work_done);
-#ifndef MYSQLND_SILENT
- printf(Signaling work done in %s\n, __FUNCTION__);
-#endif
- pthread_mutex_unlock(conn-LOCK_work);
- } while (1);
-
-#ifndef MYSQLND_SILENT
- printf(Exiting worker thread in %s\n, __FUNCTION__);
-#endif
- return NULL;
-}
-/* }}} */
-#endif /* MYSQLND_THREADED */
-
/* {{{ mysqlnd_library_init */
void mysqlnd_library_init(TSRMLS_D)
@@ -839,7 +782,7 @@
pthread_attr_setdetachstate(connection_attrib,
PTHREAD_CREATE_DETACHED);
conn-thread_is_running = TRUE;
- if (pthread_create(th, connection_attrib,
_mysqlnd_fetch_thread, (void*)conn)) {
+ if (pthread_create(th,