Bug 60835 - initializeMainThread in jsc executable
Summary: initializeMainThread in jsc executable
Status: RESOLVED DUPLICATE of bug 59762
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-14 02:04 PDT by Patrick R. Gansterer
Modified: 2011-05-14 22:02 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.22 KB, patch)
2011-05-14 02:07 PDT, Patrick R. Gansterer
ap: review-
ap: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.