Perform internal qc initialization

This commit is contained in:
Johan Wikman
2017-03-10 14:13:32 +02:00
parent a58f944f23
commit 0985a18a7e

View File

@ -976,6 +976,8 @@ static void usage(void)
* @param arg The thread argument.
*/
void worker_thread_main(void* arg)
{
if (qc_thread_init(QC_INIT_SELF))
{
if (modules_thread_init())
{
@ -987,6 +989,14 @@ void worker_thread_main(void* arg)
{
MXS_ERROR("Could not perform thread initialization for all modules. Thread exits.");
}
qc_thread_end(QC_INIT_SELF);
}
else
{
MXS_ERROR("Could not perform thread initialization for the "
"internal query classifier. Thread exits.");
}
}
/**
@ -1918,6 +1928,16 @@ int main(int argc, char **argv)
dcb_global_init();
/* Initialize the internal query classifier. The plugin will be initialized
* via the module initialization below.
*/
if (!qc_process_init(QC_INIT_SELF))
{
MXS_ERROR("Failed to initialize the internal query classifier.");
rc = MAXSCALE_INTERNALERROR;
goto return_main;
}
/* Init MaxScale modules */
if (!modules_process_init())
{
@ -2036,6 +2056,11 @@ int main(int argc, char **argv)
/*< Call finish on all modules. */
modules_process_finish();
/* Finalize the internal query classifier. The plugin was finalized
* via the module finalizarion above.
*/
qc_process_end(QC_INIT_SELF);
log_exit_status();
MXS_NOTICE("MaxScale is shutting down.");