Thread initialization added

Also the main thread must now explicitly be initialized.
This commit is contained in:
Johan Wikman 2017-09-25 14:04:03 +03:00
parent 551bfb6f26
commit 621b66ab13
3 changed files with 8 additions and 4 deletions

View File

@ -313,7 +313,9 @@ int main(int argc, char** argv)
if (mxs_log_init(NULL, ".", MXS_LOG_TARGET_DEFAULT))
{
if (qc_setup(lib, QC_SQL_MODE_DEFAULT, NULL) && qc_process_init(QC_INIT_BOTH))
if (qc_setup(lib, QC_SQL_MODE_DEFAULT, NULL) &&
qc_process_init(QC_INIT_BOTH) &&
qc_thread_init(QC_INIT_BOTH))
{
rc = run(input_name, expected_name);
qc_process_end(QC_INIT_BOTH);

View File

@ -41,7 +41,9 @@ int main()
set_libdir(strdup("../qc_sqlite"));
if (qc_setup("qc_sqlite", QC_SQL_MODE_DEFAULT, NULL) && qc_process_init(QC_INIT_BOTH))
if (qc_setup("qc_sqlite", QC_SQL_MODE_DEFAULT, NULL) &&
qc_process_init(QC_INIT_BOTH) &&
qc_thread_init(QC_INIT_BOTH))
{
const char s[] = "SELECT @@global.max_allowed_packet";

View File

@ -133,13 +133,13 @@ int main(int argc, char* argv[])
if (qc_setup(QC_LIB, QC_SQL_MODE_DEFAULT, NULL))
{
if (qc_process_init(QC_INIT_BOTH))
if (qc_process_init(QC_INIT_BOTH) && qc_thread_init(QC_INIT_BOTH))
{
rc = test();
}
else
{
cerr << "error: Could not perform process initialization for " << QC_LIB << "." << endl;
cerr << "error: Could not perform process/thread initialization for " << QC_LIB << "." << endl;
}
}
else