summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-05-20 00:54:06 (GMT)
committerBill King <bill.king@nokia.com>2009-05-20 00:54:06 (GMT)
commit19845ac3f4f7e3288cfdf7add68754758cd3145b (patch)
treebe3c6aa25b6083740f0bcad082b52e4e8db9fe11 /src/sql
parentc06dd76ca4b30fa71297e640a8eaf702d606e937 (diff)
downloadQt-19845ac3f4f7e3288cfdf7add68754758cd3145b.zip
Qt-19845ac3f4f7e3288cfdf7add68754758cd3145b.tar.gz
Qt-19845ac3f4f7e3288cfdf7add68754758cd3145b.tar.bz2
Adds thread initialisation/cleanup code to mysql.
Allows for cleaner multi-thread working for mysql clients. Task-number: 253407
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index fbefa0c..51fc306 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -1279,6 +1279,11 @@ bool QMYSQLDriver::open(const QString& db,
d->preparedQuerysEnabled = false;
#endif
+#ifndef QT_NO_THREAD
+ mysql_thread_init();
+#endif
+
+
setOpen(true);
setOpenError(false);
return true;
@@ -1287,6 +1292,9 @@ bool QMYSQLDriver::open(const QString& db,
void QMYSQLDriver::close()
{
if (isOpen()) {
+#ifndef QT_NO_THREAD
+ mysql_thread_end();
+#endif
mysql_close(d->mysql);
d->mysql = NULL;
setOpen(false);