summaryrefslogtreecommitdiff
path: root/mysys/default.c
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-08-24 18:06:44 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-08-24 18:06:44 +0300
commit06d80f111958ff9bebc9ccb4c58b9ba362484c00 (patch)
tree0138f5d935b18977e1a6b7773e36a4ccfda7cf3a /mysys/default.c
parent0aefd73b3dda1705270fb756329c32e10e1cc476 (diff)
downloadmariadb-git-06d80f111958ff9bebc9ccb4c58b9ba362484c00.tar.gz
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() include/my_pthread.h: Bug #28284: move the fast mutexes initialization out of my_pthread_fastmutex_lock() to fastmutex_global_init() and call it from my_init() mysys/my_init.c: Bug #28284: move the fast mutexes initialization out of my_pthread_fastmutex_lock() to fastmutex_global_init() and call it from my_init() mysys/thr_mutex.c: Bug #28284: move the fast mutexes initialization out of my_pthread_fastmutex_lock() to fastmutex_global_init() and call it from my_init()
Diffstat (limited to 'mysys/default.c')
0 files changed, 0 insertions, 0 deletions