<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Possible fix for JSC api test failures in debug mode after r187020."
   href="https://bugs.webkit.org/show_bug.cgi?id=147110#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Possible fix for JSC api test failures in debug mode after r187020."
   href="https://bugs.webkit.org/show_bug.cgi?id=147110">bug 147110</a>
              from <span class="vcard"><a class="email" href="mailto:peavo&#64;outlook.com" title="peavo&#64;outlook.com">peavo&#64;outlook.com</a>
</span></b>
        <pre>Is this a possible scenario for the assert?

A thread not created with WTF::createThread() calls WTF::currentThread(), and then exits.
Next a thread created with WTF::createThread reuses the pthread_t handle, and then asserts.

For example, I see that JavaScriptCore\API\tests\testapi.mm is creating a thread using just pthread_create:

    &#64;autoreleasepool {
        JSContext *context = [[JSContext alloc] init];

        pthread_t threadID;
        pthread_create(&amp;threadID, NULL, &amp;threadMain, (__bridge void*)context);
        pthread_join(threadID, nullptr);
        JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]);

        checkResult(&#64;&quot;Did not crash after entering the VM from another thread&quot;, true);
    }</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>