[webkit-help] JavaScriptCore and threading

Justin Thomas justin at sweaky.com
Fri Oct 14 19:48:59 PDT 2011


Hi All,

I'm been trying to create a new context in a new thread using 
JSGlobalContextCreateInGroup but I can't seem to get around an "access 
violation exception while writing to...", is this not the correct way to 
setup mutlithreading? I assumed that for each thread created a separate 
context should be used. I am passing in the same group that was created 
from the main thread each time I try to create a new global context.

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?

I'm using the latest webkit built on my windows box.

Thanks,
  -JT

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20111014/0ebcf280/attachment.html>


More information about the webkit-help mailing list