Bug 168996

Summary: Change JSLock to stash PlatformThread instead of std::thread::id.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, fpizlo, ggaren, jfbastien, keith_miller, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 168920    
Attachments:
Description Flags
proposed patch.
none
proposed patch.
saam: review+
patch for landing.
none
patch for landing: added a comment in JSLock to explain why m_ownerThread cannot be an optional. none

Mark Lam
Reported 2017-02-28 15:45:53 PST
PlatformThread is more useful because it allows us to: 1. suspend / resume threads. 2. find the MachineThreads::Thread which is associated with it. 3. send a signal to the thread.
Attachments
proposed patch. (20.33 KB, patch)
2017-02-28 16:19 PST, Mark Lam
no flags
proposed patch. (18.60 KB, patch)
2017-03-01 11:23 PST, Mark Lam
saam: review+
patch for landing. (20.92 KB, patch)
2017-03-01 11:50 PST, Mark Lam
no flags
patch for landing: added a comment in JSLock to explain why m_ownerThread cannot be an optional. (21.21 KB, patch)
2017-03-01 12:04 PST, Mark Lam
no flags
Mark Lam
Comment 1 2017-02-28 16:19:58 PST
Created attachment 303005 [details] proposed patch. Let's test this on the EWS.
Mark Lam
Comment 2 2017-02-28 18:28:40 PST
Comment on attachment 303005 [details] proposed patch. Thanks for the review.
WebKit Commit Bot
Comment 3 2017-02-28 18:56:11 PST
Comment on attachment 303005 [details] proposed patch. Clearing flags on attachment: 303005 Committed r213202: <http://trac.webkit.org/changeset/213202>
WebKit Commit Bot
Comment 4 2017-02-28 18:56:17 PST
All reviewed patches have been landed. Closing bug.
Mark Lam
Comment 5 2017-03-01 10:54:27 PST
The patch has been rolled out in r213231: <http://trac.webkit.org/r213231>.
Mark Lam
Comment 6 2017-03-01 11:23:31 PST
Created attachment 303087 [details] proposed patch.
Saam Barati
Comment 7 2017-03-01 11:42:55 PST
Comment on attachment 303087 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=303087&action=review r=me > Source/JavaScriptCore/runtime/JSLock.cpp:173 > + WTF::storeStoreFence(); This isn't necessary > Source/JavaScriptCore/runtime/JSLock.h:96 > + std::optional<PlatformThread> ownerThread() const { return m_ownerThread; } you need to do the right thing here by checking m_hasOwnerThread
Mark Lam
Comment 8 2017-03-01 11:49:31 PST
Comment on attachment 303087 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=303087&action=review Thanks for the review. >> Source/JavaScriptCore/runtime/JSLock.cpp:173 >> + WTF::storeStoreFence(); > > This isn't necessary I've removed this. >> Source/JavaScriptCore/runtime/JSLock.h:96 >> + std::optional<PlatformThread> ownerThread() const { return m_ownerThread; } > > you need to do the right thing here by checking m_hasOwnerThread Fixed.
Mark Lam
Comment 9 2017-03-01 11:50:01 PST
Created attachment 303092 [details] patch for landing.
Mark Lam
Comment 10 2017-03-01 12:04:02 PST
Created attachment 303095 [details] patch for landing: added a comment in JSLock to explain why m_ownerThread cannot be an optional.
Mark Lam
Comment 11 2017-03-01 12:18:03 PST
Thanks for the review. Landed in r213238: <http://trac.webkit.org/r213238>.
Note You need to log in before you can comment on or make changes to this bug.