1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-36684 - main.mdl_sync fails under valgrind (test for Bug#42643)

Valgrind is single threaded and only changes threads as part of
system calls or waits.

Some busy loops were identified and fixed where the server assumes
that some other thread will change the state, which will not happen
with valgrind.

Based on patch by Monty. Original patch introduced VALGRIND_YIELD,
which emits pthread_yield() only in valgrind builds. However it was
agreed that it is a good idea to emit yield() unconditionally, such
that other affected schedulers (like SCHED_FIFO) benefit from this
change. Also avoid pthread_yield() in favour of standard
std::this_thread::yield().
This commit is contained in:
Sergey Vojtovich
2025-04-28 22:45:10 +04:00
parent 83e0438f62
commit 55ddfe1c95
4 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,7 @@
/* Classes in mysql */
#include <atomic>
#include <thread>
#include "dur_prop.h"
#include <waiting_threads.h>
#include "sql_const.h"