mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Windows improvements : manual backport of
htttp://lists.mysql.com/commits/50957?f=plain Always use TLS functions instead of __declspec(thread) to access thread local storage variables. The change removes the necessity to recomplile the same source files twice - with USE_TLS for DLLs and without USE_TLS for EXEs. Real benefit of this change is better readability and maintainability of TLS functions within MySQL. There is a performance loss using TlsXXX functions compared to __declspec but the difference is negligible in practice. In a sysbench-like benchmark I ran with with TlsGetValue, pthread_[get|set]_specific was called 600000000 times and took 0.17sec of total 35min CPU time, or 0.008%.
This commit is contained in:
@ -16,12 +16,6 @@
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
# Need to set USE_TLS, since __declspec(thread) approach to thread local
|
||||
# storage does not work properly in DLLs.
|
||||
IF(WIN32)
|
||||
ADD_DEFINITIONS(-DUSE_TLS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
ADD_DEFINITIONS(-DMYSQL_SERVER -DEMBEDDED_LIBRARY -DHAVE_DLOPEN)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
||||
|
@ -20,9 +20,6 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/extra/yassl/include)
|
||||
|
||||
# Currently does not work with DBUG, there are missing symbols reported.
|
||||
IF(WIN32)
|
||||
ADD_DEFINITIONS(-DUSE_TLS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
|
||||
|
||||
|
Reference in New Issue
Block a user