summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2008-01-29 18:11:46 +0000
committerAndrey Hristov <andrey@php.net>2008-01-29 18:11:46 +0000
commit829831f5bae038fd375fc5cbd66ae1d0f19a07ff (patch)
treebe2c5717d7509811e16eb3cd2dcf1140fdf7e866 /ext/mysqlnd/mysqlnd.c
parentc08da2a66de6f9c07540ecf75e140b3707678021 (diff)
downloadphp-git-829831f5bae038fd375fc5cbd66ae1d0f19a07ff.tar.gz
Fix the build, add a missing file
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r--ext/mysqlnd/mysqlnd.c59
1 files changed, 1 insertions, 58 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 9f22912356..d1703a252a 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -68,63 +68,6 @@ static zend_bool mysqlnd_library_initted = FALSE;
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 @@ PHPAPI MYSQLND *mysqlnd_connect(MYSQLND *conn,
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, &connection_attrib, mysqlnd_fetch_thread, (void*)conn)) {
conn->thread_is_running = FALSE;
}
}