2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-11-11 14:52:30 -08:00
|
|
|
|
|
|
|
#ifndef nsCycleCollectorUtils_h__
|
|
|
|
#define nsCycleCollectorUtils_h__
|
|
|
|
|
|
|
|
#include "nscore.h"
|
|
|
|
#include "mozilla/threads/nsThreadIDs.h"
|
|
|
|
|
|
|
|
#if defined(MOZILLA_INTERNAL_API)
|
|
|
|
#define NS_IsCycleCollectorThread NS_IsCycleCollectorThread_P
|
|
|
|
#if defined(XP_WIN)
|
2011-08-18 06:46:39 -07:00
|
|
|
bool NS_IsCycleCollectorThread();
|
2010-11-11 14:52:30 -08:00
|
|
|
#elif defined(NS_TLS)
|
|
|
|
// Defined in nsThreadManager.cpp.
|
|
|
|
extern NS_TLS mozilla::threads::ID gTLSThreadID;
|
|
|
|
inline bool NS_IsCycleCollectorThread()
|
|
|
|
{
|
|
|
|
return gTLSThreadID == mozilla::threads::CycleCollector;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
NS_COM_GLUE bool NS_IsCycleCollectorThread();
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
NS_COM_GLUE bool NS_IsCycleCollectorThread();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* nsCycleCollectorUtils_h__ */
|