MDEV-30900 Crash on macOS due to zero-initialized buf_dblwr.write_cond

buf_dblwr_t::init(), buf_dblwr_t::close(): Cover also write_cond,
which was added in commit a55b951e60
without explicit initialization. On GNU/Linux, PTHREAD_COND_INITIALIZER
is a zero-initializer. That is why the default zero initialization
happened to work on that platform.
This commit is contained in:
Marko Mäkelä 2023-03-24 07:59:27 +02:00
parent 15ca6c5a2f
commit 07460c31e3

View file

@ -53,6 +53,7 @@ void buf_dblwr_t::init()
active_slot= &slots[0];
mysql_mutex_init(buf_dblwr_mutex_key, &mutex, nullptr);
pthread_cond_init(&cond, nullptr);
pthread_cond_init(&write_cond, nullptr);
}
}
@ -468,6 +469,7 @@ void buf_dblwr_t::close()
ut_ad(!batch_running);
pthread_cond_destroy(&cond);
pthread_cond_destroy(&write_cond);
for (int i= 0; i < 2; i++)
{
aligned_free(slots[i].write_buf);