Bug 677079 - Part q: Expose gcLock in jsfriendapi.h; r=gal

This commit is contained in:
Ms2ger 2012-01-15 09:13:10 +01:00
parent 59f812e2ba
commit a68763cbfd
3 changed files with 12 additions and 2 deletions

View File

@ -533,6 +533,12 @@ GetContextOutstandingRequests(const JSContext *cx)
{
return cx->outstandingRequests;
}
JS_FRIEND_API(PRLock *)
GetRuntimeGCLock(const JSRuntime *rt)
{
return rt->gcLock;
}
#endif
JS_FRIEND_API(JSCompartment *)

View File

@ -153,6 +153,8 @@ JS_END_EXTERN_C
#ifdef __cplusplus
struct PRLock;
namespace js {
typedef bool
@ -456,6 +458,9 @@ GetContextThread(const JSContext *cx);
JS_FRIEND_API(unsigned)
GetContextOutstandingRequests(const JSContext *cx);
JS_FRIEND_API(PRLock *)
GetRuntimeGCLock(const JSRuntime *rt);
#endif
JS_FRIEND_API(JSCompartment *)

View File

@ -67,7 +67,6 @@
#include "jscntxt.h"
#if 0
js_NextActiveContext, js::TriggerOperationCallback
mWatchdogWakeup = JS_NEW_CONDVAR(mJSRuntime->gcLock);
#endif
using namespace mozilla;
@ -1980,7 +1979,7 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
JS_EnumerateDiagnosticMemoryRegions(DiagnosticMemoryCallback);
#endif
JS_SetAccumulateTelemetryCallback(mJSRuntime, AccumulateTelemetryCallback);
mWatchdogWakeup = JS_NEW_CONDVAR(mJSRuntime->gcLock);
mWatchdogWakeup = JS_NEW_CONDVAR(js::GetRuntimeGCLock(mJSRuntime));
if (!mWatchdogWakeup)
NS_RUNTIMEABORT("JS_NEW_CONDVAR failed.");