зеркало из https://github.com/mozilla/gecko-dev.git
Bug 923486, part 2 - Define NS_IsMainThread out-of-line in ASAN builds. r=ehsan
This commit is contained in:
Родитель
ed66d6fc41
Коммит
45c94c7843
|
@ -29,14 +29,14 @@ bool NS_IsMainThread();
|
||||||
extern NS_TLS mozilla::threads::ID gTLSThreadID;
|
extern NS_TLS mozilla::threads::ID gTLSThreadID;
|
||||||
#ifdef MOZ_ASAN
|
#ifdef MOZ_ASAN
|
||||||
// Temporary workaround, see bug 895845
|
// Temporary workaround, see bug 895845
|
||||||
MOZ_ASAN_BLACKLIST static
|
MOZ_ASAN_BLACKLIST bool NS_IsMainThread();
|
||||||
#else
|
#else
|
||||||
inline
|
inline
|
||||||
#endif
|
|
||||||
bool NS_IsMainThread()
|
bool NS_IsMainThread()
|
||||||
{
|
{
|
||||||
return gTLSThreadID == mozilla::threads::Main;
|
return gTLSThreadID == mozilla::threads::Main;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
/**
|
/**
|
||||||
* Test to see if the current thread is the main thread.
|
* Test to see if the current thread is the main thread.
|
||||||
|
|
|
@ -122,7 +122,15 @@ NS_IsMainThread()
|
||||||
return TlsGetValue(gTLSThreadIDIndex) == (void*) mozilla::threads::Main;
|
return TlsGetValue(gTLSThreadIDIndex) == (void*) mozilla::threads::Main;
|
||||||
}
|
}
|
||||||
#elif defined(MOZILLA_INTERNAL_API) && defined(NS_TLS)
|
#elif defined(MOZILLA_INTERNAL_API) && defined(NS_TLS)
|
||||||
|
#ifdef MOZ_ASAN
|
||||||
|
// Temporary workaround, see bug 895845
|
||||||
|
bool NS_IsMainThread()
|
||||||
|
{
|
||||||
|
return gTLSThreadID == mozilla::threads::Main;
|
||||||
|
}
|
||||||
|
#else
|
||||||
// NS_IsMainThread() is defined inline in MainThreadUtils.h
|
// NS_IsMainThread() is defined inline in MainThreadUtils.h
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#ifdef MOZILLA_INTERNAL_API
|
#ifdef MOZILLA_INTERNAL_API
|
||||||
bool NS_IsMainThread()
|
bool NS_IsMainThread()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче