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:
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user