[webkit-help] JavaScriptCore and threading

Julien Chaffraix julien.chaffraix at gmail.com
Thu Oct 20 07:40:33 PDT 2011


> Some code:
>
> // Main thread
> mMainGroup = JSContextGroupCreate();
> mMainContext = JSGlobalContextCreateInGroup(mMainGroup, NULL);
>
> // Secondary thread
> mOtherContext = JSGlobalContextCreateInGroup(mMainGroup, NULL); // <- fails
> here
>
> When looking through it is failing at the assertion in RefCounted.h:53,
> ASSERT(m_verifier.isSafeToUse()), which looks like the verifier is set to
> SingleThreadVerificationMode, I'm thinking it's pretty obvious that needs to
> be changed, but not sure how to go about setting a new verification mode?

Just FYI this is a good internal WebKit ASSERT. RefCounted does NOT
work well with different threads and this is designed to pick up
internal abuse. However I don't think there is a way for you to change
the verifier without changing WebKit even if you provide your own
synchronization and don't abuse the API.

The best course would be to file a bug on webkit.org about that. The
JSC gurus could then decide the best way to handle that.

Thanks,
Julien


More information about the webkit-help mailing list