Bug 177729

Summary: Use ThreadIdentifier instead of thread::this_thread::get_id
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch sam: review+

Yusuke Suzuki
Reported 2017-10-01 17:06:38 PDT
Use ThreadIdentifier instead of thread::this_thread::get_id
Attachments
Patch (3.25 KB, patch)
2017-10-01 17:07 PDT, Yusuke Suzuki
no flags
Patch (3.38 KB, patch)
2017-10-02 01:18 PDT, Yusuke Suzuki
sam: review+
Yusuke Suzuki
Comment 1 2017-10-01 17:07:14 PDT
Sam Weinig
Comment 2 2017-10-01 17:26:31 PDT
Comment on attachment 322338 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322338&action=review > Source/WebCore/ChangeLog:8 > + We can use WTF::ThreadIdentifier instead of thread::this_thread::get_id. Can you explain why this is preferable? I assume it is more efficient.
Yusuke Suzuki
Comment 3 2017-10-02 01:16:38 PDT
Comment on attachment 322338 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322338&action=review I'll fix build failure by including <wtf/Threading.h> >> Source/WebCore/ChangeLog:8 >> + We can use WTF::ThreadIdentifier instead of thread::this_thread::get_id. > > Can you explain why this is preferable? I assume it is more efficient. There are two reasons, 1. thread::this_thread::get_id is slower in Windows 2. using ThreadIdentifier is consistent to the other code in WebKit. Other part of WebKit just uses ThreadIdentifier for the exact same purpose (debugging threadID). Only this place uses thread::this_thread::get_id.
Yusuke Suzuki
Comment 4 2017-10-02 01:18:58 PDT
Sam Weinig
Comment 5 2017-10-02 10:19:26 PDT
Comment on attachment 322361 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322361&action=review > Source/WebCore/ChangeLog:8 > + We can use WTF::ThreadIdentifier instead of thread::this_thread::get_id. Please put your more detailed explanation of why in the ChangeLog.
Yusuke Suzuki
Comment 6 2017-10-02 10:37:58 PDT
Comment on attachment 322361 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322361&action=review >> Source/WebCore/ChangeLog:8 >> + We can use WTF::ThreadIdentifier instead of thread::this_thread::get_id. > > Please put your more detailed explanation of why in the ChangeLog. Thanks, I've just added these explanation to this ChangeLog :)
Yusuke Suzuki
Comment 7 2017-10-02 10:53:00 PDT
Radar WebKit Bug Importer
Comment 8 2017-10-02 10:54:12 PDT
Note You need to log in before you can comment on or make changes to this bug.