Monitors that run on separate thread call thread_wait in stopMonitor.

Fixes problem with ordering of calls to mysql_library_end (in main) and mysql_thread_end (in monitor thr).
This commit is contained in:
vraatikka
2013-07-26 11:27:54 +03:00
parent 03e70ab78f
commit 867eab37fc
3 changed files with 29 additions and 26 deletions

View File

@ -117,7 +117,7 @@ MYSQL_MONITOR *handle;
handle->deaultPasswd = NULL;
spinlock_init(&handle->lock);
}
thread_start(monitorMain, handle);
handle->tid = thread_start(monitorMain, handle);
return handle;
}
@ -131,7 +131,8 @@ stopMonitor(void *arg)
{
MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg;
handle->shutdown = 1;
handle->shutdown = 1;
thread_wait(handle->tid);
}
/**