Skip to content
Snippets Groups Projects
Commit 246d4cda authored by deuce's avatar deuce
Browse files

Add a pair of patches to allow request debugging.

parent 0ec877c8
No related branches found
No related tags found
No related merge requests found
--- js-1.8.5/js/src/jsapi.cpp.orig 2011-10-28 18:26:10.000000000 -0700
+++ js-1.8.5/js/src/jsapi.cpp 2011-10-28 18:33:03.000000000 -0700
@@ -955,6 +955,28 @@
#endif
}
+JS_PUBLIC_API(jsrefcount)
+JS_RequestDepth(JSContext *cx)
+{
+#ifdef JS_THREADSAFE
+ JS_ASSERT(CURRENT_THREAD_IS_ME(cx->thread));
+ return JS_THREAD_DATA(cx)->requestDepth;
+#else
+ return false;
+#endif
+}
+
+JS_PUBLIC_API(jsrefcount)
+JS_SuspendDepth(JSContext *cx)
+{
+#ifdef JS_THREADSAFE
+ JS_ASSERT(CURRENT_THREAD_IS_ME(cx->thread));
+ return cx->thread->suspendCount;
+#else
+ return false;
+#endif
+}
+
JS_PUBLIC_API(void)
JS_Lock(JSRuntime *rt)
{
--- js-1.8.5/js/src/jsapi.h.orig 2011-10-28 18:26:04.000000000 -0700
+++ js-1.8.5/js/src/jsapi.h 2011-10-28 18:27:44.000000000 -0700
@@ -758,6 +758,12 @@
extern JS_PUBLIC_API(JSBool)
JS_IsInRequest(JSContext *cx);
+extern JS_PUBLIC_API(jsrefcount)
+JS_RequestDepth(JSContext *cx);
+
+extern JS_PUBLIC_API(jsrefcount)
+JS_SuspendDepth(JSContext *cx);
+
#ifdef __cplusplus
JS_END_EXTERN_C
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment