Commit 7235d201 authored by Andrii Grynenko's avatar Andrii Grynenko Committed by Facebook Github Bot 5

Disable PthreadKeyUnregister on iOS and MSVC

Summary: ~PthreadKeyUnregister logic is not safe if we can't guarantee that it has the maximum pririty (i.e. is the last to be run on shutdown).

Reviewed By: ericniebler

Differential Revision: D3517589

fbshipit-source-id: 3340e2e19cf52973ee677288bc4ac6105f3f2543
parent a3bd593a
......@@ -172,10 +172,14 @@ class PthreadKeyUnregister {
static constexpr size_t kMaxKeys = 1UL << 16;
~PthreadKeyUnregister() {
// If static constructor priorities are not supported then
// ~PthreadKeyUnregister logic is not safe.
#if !defined(__APPLE__) && !defined(_MSC_VER)
MSLGuard lg(lock_);
while (size_) {
pthread_key_delete(keys_[--size_]);
}
#endif
}
static void registerKey(pthread_key_t key) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment