Bug #85982 Use C++11 thread-local storage for current_thd
Submitted: 18 Apr 2017 11:20 Modified: 19 Apr 2017 13:17
Reporter: Steinar Gunderson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.2 OS:Any
Assigned to: CPU Architecture:Any

[18 Apr 2017 11:20] Steinar Gunderson
Description:
Our current implementation of current_thd uses mysys' my_thread_* API, which maps onto pthreads (at least for Linux/UNIX). C++11 supports native TLS, which means we just need two simple MOV instructions to do a TLS fetch instead of a full shared library call; the interface is also much simpler. We probably don't have a lot of performance gain, since we don't pick out current_thd all that often, but it'd be nice to do the cleanup nevertheless.

How to repeat:
N/A

Suggested fix:
Use thread_local.
[19 Apr 2017 13:17] Paul DuBois
Posted by developer:
 
Fixed in 8.0.2.

Code cleanup. No changelog entry needed.