[PATCH] [libc++] Fix PR22606 - Leak pthread_key with static storage duration to ensure all of thread-local destructors are called.

Eric Fiselier eric at efcs.ca
Mon Apr 6 10:00:17 PDT 2015


In http://reviews.llvm.org/D8802#151897, @mclow.lists wrote:

> (just to make sure that I understand), I see two changes here :
>
> 1. Some code movement (line 310-ish to line 116-ish). No real functionality change there.
> 2. Make the constructor for `__thread_specific_ptr` private, and add a friend decl for `__thread_local_data`.
>
>   Is that correct?


That is correct, but for some reason this patch itself is incorrect. there should be a third change:

- `~__thread_specific_ptr()` does not call `pthread_key_delete(__key_)`




http://reviews.llvm.org/D8802

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list