mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug #28284: Test "mysqlslap" reports "out of memory"
When locking a "fast" mutex a static variable cpu_count was used as a flag to initialize itself on the first usage by calling sysconf() and setting non-zero value. This is not thread and optimization safe on some platforms. That's why the global initialization needs to be done once in a designated function. This will also speed up the usage (by a small bit) because it won't have to check if it's initialized on every call. Fixed by moving the fast mutexes initialization out of my_pthread_fastmutex_lock() to fastmutex_global_init() and call it from my_init()
This commit is contained in:
@ -78,6 +78,9 @@ my_bool my_init(void)
|
||||
my_umask_dir= 0700; /* Default umask for new directories */
|
||||
#if defined(THREAD) && defined(SAFE_MUTEX)
|
||||
safe_mutex_global_init(); /* Must be called early */
|
||||
#endif
|
||||
#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
|
||||
fastmutex_global_init(); /* Must be called early */
|
||||
#endif
|
||||
netware_init();
|
||||
#ifdef THREAD
|
||||
|
Reference in New Issue
Block a user