From 2bc1930c6c40b964fce9c698a1ca75da3138ad63 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 30 Sep 2009 03:22:57 +0200 Subject: 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%. --- mysys/my_winthread.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'mysys/my_winthread.c') diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c index e94369bec32..543e1787fb6 100644 --- a/mysys/my_winthread.c +++ b/mysys/my_winthread.c @@ -129,12 +129,5 @@ void pthread_exit(void *a) _endthread(); } -/* This is neaded to get the macro pthread_setspecific to work */ - -int win_pthread_setspecific(void *a,void *b,uint length) -{ - memcpy(a,b,length); - return 0; -} #endif -- cgit v1.2.1