[Webkit-unassigned] [Bug 38097] Disentangle initializing the main thread from initializing threading

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 25 19:39:47 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=38097


Maciej Stachowiak <mjs at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #54247|review?                     |review-
               Flag|                            |




--- Comment #5 from Maciej Stachowiak <mjs at apple.com>  2010-04-25 19:39:47 PST ---
(From update of attachment 54247)
Some minor comments below. Overall this seems reasonable other than the
"deprecated" naming. ALso I think it would be good to log or assert or throw an
exception or something in the cases where deprecatedInitializeMainThread is
called from a thread other than the main thread (since it implies misuse of the
original WebKit API). r- to consider these issues, please upload a fresh
version.

JavaScriptCore/ChangeLog:15
 +          (WTF::deprecatedInitializeMainThread):
The difference between initializeMainThread and deprecatedInitializeMainThread
is not clear from the names. Also from offline discussion it seems like the
"deprecated" version is not going away soon or possibly ever, so that doesn't
seem like a very good name.

JavaScriptCore/wtf/MainThread.cpp:101
 +      MutexLocker locker(mainThreadInitializationMutex());
Why a mutex here instead of a "once" type mechanism like pthread_once?

JavaScriptCore/wtf/mac/MainThreadMac.mm:75
 +  void deprecatedInitializeMainThreadPlatform()
it looks to me like mainThreadPthread will never be initialized if WebKit is
called off the main thread the first time, even on platforms where it would
otherwise be initialized to pthread_self(). Is that ok?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list