Bug 60835

Summary: initializeMainThread in jsc executable
Product: WebKit Reporter: Patrick R. Gansterer <paroga>
Component: New BugsAssignee: Patrick R. Gansterer <paroga>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: abarth, ap, barraclough, levin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ap: review-, ap: commit-queue-

Description Patrick R. Gansterer 2011-05-14 02:04:17 PDT
initializeMainThread in jsc executable
Comment 1 Patrick R. Gansterer 2011-05-14 02:07:08 PDT
Created attachment 93551 [details]
Patch
Comment 2 Alexey Proskuryakov 2011-05-14 11:13:20 PDT

*** This bug has been marked as a duplicate of bug 59762 ***
Comment 3 Patrick R. Gansterer 2011-05-14 12:41:32 PDT
Can you please explain the r-?
What's wrong with this change?
Isn't the knowledge about the MainThread allowed in JSC? Why is it part of WTF in that case?
At the moment we get an assertion at http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/wtf/CryptographicallyRandomNumber.cpp?rev=84466#L146 when not using ENABLE(WTF_MULTIPLE_THREADS).
I don't think that removing the assertion will be the right way???
Comment 4 Alexey Proskuryakov 2011-05-14 13:20:56 PDT
Sorry, I thought that the explanation in the bug I duped this to was sufficient. A JavaScriptCore API client can use any thread - there is no requirement that the first call to JavaScriptCore is from main thread, or that the client initializes main thread explicitly. So, jsc is testing a common and perfectly normal scenario.

> At the moment we get an assertion at http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/wtf/CryptographicallyRandomNumber.cpp?rev=84466#L146 when not using ENABLE(WTF_MULTIPLE_THREADS).

It would be cleanest to open a new bug for the symptom that you observe, and discuss solutions there. Please post a stack trace for the assertion in that bug.
Comment 5 Patrick R. Gansterer 2011-05-14 13:50:41 PDT
(In reply to comment #4)
> Sorry, I thought that the explanation in the bug I duped this to was sufficient.

I didn't find the info i wanted. :-(

> A JavaScriptCore API client can use any thread - there is no requirement that the first call to JavaScriptCore is from main thread, or that the client initializes main thread explicitly. So, jsc is testing a common and perfectly normal scenario.

IMHO then every isMainThread call is wrong in WTF/JSC and we should move MainThread to WebCore.

> > At the moment we get an assertion at http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/wtf/CryptographicallyRandomNumber.cpp?rev=84466#L146 when not using ENABLE(WTF_MULTIPLE_THREADS).
> 
> It would be cleanest to open a new bug for the symptom that you observe, and discuss solutions there. Please post a stack trace for the assertion in that bug.

Created bug 60846.
Comment 6 Alexey Proskuryakov 2011-05-14 22:02:06 PDT
> IMHO then every isMainThread call is wrong in WTF/JSC and we should move MainThread to WebCore.

There are only two uses outside MainThread.* files - in AtomicString::init() and in CryptographicallyRandomNumber.cpp. This does seem confusing and misplaced to me.