Bug 168996 - Change JSLock to stash PlatformThread instead of std::thread::id.
Summary: Change JSLock to stash PlatformThread instead of std::thread::id.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on:
Blocks: 168920
  Show dependency treegraph
 
Reported: 2017-02-28 15:45 PST by Mark Lam
Modified: 2017-03-01 12:18 PST (History)
7 users (show)

See Also:


Attachments
proposed patch. (20.33 KB, patch)
2017-02-28 16:19 PST, Mark Lam
no flags Details | Formatted Diff | Diff
proposed patch. (18.60 KB, patch)
2017-03-01 11:23 PST, Mark Lam
sbarati: review+
Details | Formatted Diff | Diff
patch for landing. (20.92 KB, patch)
2017-03-01 11:50 PST, Mark Lam
no flags Details | Formatted Diff | Diff
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 Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 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.
Comment 1 Mark Lam 2017-02-28 16:19:58 PST
Created attachment 303005 [details]
proposed patch.

Let's test this on the EWS.
Comment 2 Mark Lam 2017-02-28 18:28:40 PST
Comment on attachment 303005 [details]
proposed patch.

Thanks for the review.
Comment 3 WebKit Commit Bot 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>
Comment 4 WebKit Commit Bot 2017-02-28 18:56:17 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Mark Lam 2017-03-01 10:54:27 PST
The patch has been rolled out in r213231: <http://trac.webkit.org/r213231>.
Comment 6 Mark Lam 2017-03-01 11:23:31 PST
Created attachment 303087 [details]
proposed patch.
Comment 7 Saam Barati 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
Comment 8 Mark Lam 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.
Comment 9 Mark Lam 2017-03-01 11:50:01 PST
Created attachment 303092 [details]
patch for landing.
Comment 10 Mark Lam 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.
Comment 11 Mark Lam 2017-03-01 12:18:03 PST
Thanks for the review.  Landed in r213238: <http://trac.webkit.org/r213238>.