RESOLVED FIXED 114563
[WIN] Remove remaining calls to pthread from WTF
https://bugs.webkit.org/show_bug.cgi?id=114563
Summary [WIN] Remove remaining calls to pthread from WTF
Patrick R. Gansterer
Reported 2013-04-13 07:24:06 PDT
[WIN] Remove last calls to pthread from WTF
Attachments
Patch (4.79 KB, patch)
2013-04-13 07:42 PDT, Patrick R. Gansterer
no flags
Patch (5.15 KB, patch)
2013-04-13 09:15 PDT, Patrick R. Gansterer
no flags
Patrick R. Gansterer
Comment 1 2013-04-13 07:42:55 PDT
WebKit Commit Bot
Comment 2 2013-04-13 07:44:59 PDT
Attachment 197937 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/FastMalloc.cpp', u'Source/WTF/wtf/ThreadSpecificWin.cpp']" exit_code: 1 Source/WTF/wtf/FastMalloc.cpp:2845: heap_key is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Source/WTF/wtf/FastMalloc.cpp:3434: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 2 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 3 2013-04-13 08:18:53 PDT
Build Bot
Comment 4 2013-04-13 08:26:45 PDT
Patrick R. Gansterer
Comment 5 2013-04-13 09:15:48 PDT
WebKit Commit Bot
Comment 6 2013-04-13 09:17:49 PDT
Attachment 197943 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/FastMalloc.cpp', u'Source/WTF/wtf/ThreadSpecificWin.cpp']" exit_code: 1 Source/WTF/wtf/FastMalloc.cpp:2845: heap_key is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Source/WTF/wtf/FastMalloc.cpp:3440: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 2 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Oliver Hunt
Comment 7 2013-04-15 11:53:13 PDT
Comment on attachment 197943 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=197943&action=review > Source/WTF/wtf/ThreadSpecificWin.cpp:43 > - DEFINE_STATIC_LOCAL(DoublyLinkedList<PlatformThreadSpecificKey>, staticList, ()); > + static DoublyLinkedList<PlatformThreadSpecificKey> staticList; > return staticList; > } > > static Mutex& destructorsMutex() > { > - DEFINE_STATIC_LOCAL(Mutex, staticMutex, ()); > + static Mutex staticMutex; Why this change?
Brent Fulgham
Comment 8 2013-04-15 12:52:09 PDT
Comment on attachment 197943 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=197943&action=review This change looks good to me, and the EWS seems happy. If this change is committed, do we get to remove the pthreads library from Windows? > Source/WTF/wtf/FastMalloc.cpp:-2864 > - TlsSetValue(tlsIndex, heap); Don't we still need to use TlsSetValue? That's part of WinAPI IIRC. Or does threadSpecificSet deal with all the different platforms properly? >> Source/WTF/wtf/ThreadSpecificWin.cpp:43 >> + static Mutex staticMutex; > > Why this change? I think it's because DEFINE_STATIC_LOCAL(type, name, arguments) is defined as "static type& name = *new type arguments". > Source/WTF/wtf/ThreadSpecificWin.cpp:96 > + new (*key) PlatformThreadSpecificKey(destructor); Is placement new supported on all of our compilers?
WebKit Commit Bot
Comment 9 2013-04-15 13:22:21 PDT
Comment on attachment 197943 [details] Patch Clearing flags on attachment: 197943 Committed r148462: <http://trac.webkit.org/changeset/148462>
WebKit Commit Bot
Comment 10 2013-04-15 13:22:24 PDT
All reviewed patches have been landed. Closing bug.
Patrick R. Gansterer
Comment 11 2013-04-15 16:27:59 PDT
(In reply to comment #8) > (From update of attachment 197943 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=197943&action=review > > This change looks good to me, and the EWS seems happy. If this change is committed, do we get to remove the pthreads library from Windows? For JavaScriptCore.dll and WebKit.dll it should be possible now, but I didn't try it with the "offical build flags" (ENABLE_*). DRT needs at least bug 92505 and bug 92371 fixed. > > Source/WTF/wtf/FastMalloc.cpp:-2864 > > - TlsSetValue(tlsIndex, heap); > > Don't we still need to use TlsSetValue? That's part of WinAPI IIRC. Or does threadSpecificSet deal with all the different platforms properly? It should be possible to use threadSpecificSet() for all platforms, since it provides exactly this abstraction. > >> Source/WTF/wtf/ThreadSpecificWin.cpp:43 > >> + static Mutex staticMutex; > > > > Why this change? > > I think it's because DEFINE_STATIC_LOCAL(type, name, arguments) is defined as "static type& name = *new type arguments". Yup. > > Source/WTF/wtf/ThreadSpecificWin.cpp:96 > > + new (*key) PlatformThreadSpecificKey(destructor); > > Is placement new supported on all of our compilers? Since we use at many other places already, I would say so. :-)
Ryosuke Niwa
Comment 12 2013-04-15 19:49:30 PDT
WebKit Commit Bot
Comment 13 2013-04-15 19:50:57 PDT
Re-opened since this is blocked by bug 114658
Brent Fulgham
Comment 14 2013-04-15 20:17:54 PDT
(In reply to comment #13) > Re-opened since this is blocked by bug 114658 I'm skeptical that this change created the build failure. It doesn't touch JSC or export behavior. Strange! I'm trying a Windows build locally to see what happens.
Ryosuke Niwa
Comment 15 2013-04-15 20:23:55 PDT
Odd. The build failed even after the rollout so you're probably right that this patch isn't the culprit. I've triggered a clean build to see what happens.
Ryosuke Niwa
Comment 16 2013-04-15 20:40:58 PDT
Brent Fulgham
Comment 17 2013-04-16 13:01:30 PDT
I tried removing the 'pthreads' include path as a step to excise it from the Windows build, but started getting include errors because the pthread header is used when FORCE_SYSTEM_MALLOC is 0. This will be zero if USE_SYSTEM_MALLOC is unset. This change probably works great for WinCE, since USE_SYSTEM_MALLOC is always set, but I'm not sure what the preferred approach is for Apple's Windows port.
Patrick R. Gansterer
Comment 18 2013-04-16 13:03:25 PDT
(In reply to comment #17) > I tried removing the 'pthreads' include path as a step to excise it from the Windows build, but started getting include errors because the pthread header is used when FORCE_SYSTEM_MALLOC is 0. > > This will be zero if USE_SYSTEM_MALLOC is unset. > > This change probably works great for WinCE, since USE_SYSTEM_MALLOC is always set, but I'm not sure what the preferred approach is for Apple's Windows port. Why not add a USE(PTHREADS) around the bad include?
Roger Fong
Comment 19 2013-05-09 13:05:31 PDT
Note You need to log in before you can comment on or make changes to this bug.