mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1523949 - part 1 - make MOZ_THREAD_LOCAL name lookups work anywhere; r=erahm
MOZ_THREAD_LOCAL currently assumes its invocations live in the global namespace, which may not always be true, e.g. when declaring a static class member whose enclosing class lives in `namespace mozilla` or similar. We should qualify the name lookups required to always start from the global namespace to avoid such problems.
This commit is contained in:
parent
65862fa8e5
commit
0d56a7008a
@ -213,15 +213,15 @@ inline void ThreadLocal<T, Storage>::set(const T aValue) {
|
||||
#if (defined(XP_WIN) || defined(MACOSX_HAS_THREAD_LOCAL)) && \
|
||||
!defined(__MINGW32__)
|
||||
# define MOZ_THREAD_LOCAL(TYPE) \
|
||||
thread_local mozilla::detail::ThreadLocal< \
|
||||
TYPE, mozilla::detail::ThreadLocalNativeStorage>
|
||||
thread_local ::mozilla::detail::ThreadLocal< \
|
||||
TYPE, ::mozilla::detail::ThreadLocalNativeStorage>
|
||||
#elif defined(HAVE_THREAD_TLS_KEYWORD)
|
||||
# define MOZ_THREAD_LOCAL(TYPE) \
|
||||
__thread mozilla::detail::ThreadLocal< \
|
||||
TYPE, mozilla::detail::ThreadLocalNativeStorage>
|
||||
__thread ::mozilla::detail::ThreadLocal< \
|
||||
TYPE, ::mozilla::detail::ThreadLocalNativeStorage>
|
||||
#else
|
||||
# define MOZ_THREAD_LOCAL(TYPE) \
|
||||
mozilla::detail::ThreadLocal<TYPE, mozilla::detail::ThreadLocalKeyStorage>
|
||||
::mozilla::detail::ThreadLocal<TYPE, ::mozilla::detail::ThreadLocalKeyStorage>
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
Loading…
Reference in New Issue
Block a user