1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Added VALGRIND_YIELD to be able to abort from busy loops

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

I found some busy loops where the server assumes that some other
thread will change the state, which will not happen with valgrind.

Added VALGRIND_YIELD to the loops, which calls pthread_yield() if
HAVE_VALGRIND is defined.

Added pthread_yield() to the loops in table_cache.

We should consider changing some of the VALGRIND_YIELD calls to call
pthread_yield() as busy loop without any sleep() is usually a bad
thing.

Reviewer: svojtovich@gmail.com
This commit is contained in:
Monty
2025-01-20 19:30:19 +02:00
parent d9c3b775b8
commit aae9b50a53
4 changed files with 11 additions and 0 deletions

View File

@@ -4721,6 +4721,7 @@ restart:
goto error;
error= FALSE;
pthread_yield();
goto restart;
}
goto error;
@@ -4786,6 +4787,7 @@ restart:
error= FALSE;
sroutine_to_open= &thd->lex->sroutines_list.first;
pthread_yield();
goto restart;
}
/*