Fix folly/experimental/hazptr/ under gcc7
Summary: [Folly] Fix `folly/experimental/hazptr/` under gcc7, which has a bug in emitting TLS init functions for `extern thread_local` variables. Fixes: ``` folly/experimental/hazptr/test/HazptrTest.cpp:642: error: undefined reference to 'TLS init function for folly::hazptr::tls_priv_data_' folly/experimental/hazptr/test/HazptrTest.cpp:642: error: undefined reference to 'TLS init function for folly::hazptr::tls_priv_data_' ``` The trick is to use a template class with `static thread_local` members with member definitions in the same header, and then to use only one instance of that template class. Reviewed By: pixelb, magedm Differential Revision: D7047235 fbshipit-source-id: 0551179a40f13796d6c0bb99aa806c73bd9dd471
Showing
Please register or sign in to comment