Bug 206443

Summary: [bmalloc] Define alias for std::unique_lock and std::lock_guard for better readability
Product: WebKit Reporter: Basuke Suzuki <Basuke.Suzuki>
Component: bmallocAssignee: Basuke Suzuki <Basuke.Suzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: Basuke.Suzuki, commit-queue, ggaren, saam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=206451
Attachments:
Description Flags
PATCH
ysuzuki: review-
PATCH none

Description Basuke Suzuki 2020-01-17 14:07:52 PST
std::unique_lock and std::lock_guard are long name and a bit harder to distinguish them each other. Define simple type name for them.
Comment 1 Basuke Suzuki 2020-01-17 14:14:33 PST
Created attachment 388089 [details]
PATCH
Comment 2 Yusuke Suzuki 2020-01-17 14:50:07 PST
Comment on attachment 388089 [details]
PATCH

View in context: https://bugs.webkit.org/attachment.cgi?id=388089&action=review

Loks good overall.

> Source/bmalloc/bmalloc/Mutex.h:41
> +using SimpleLock = std::lock_guard<Mutex>;

Rename it to UniqueLockHolder and LockHolder. The name “Lock” means the lock itself instead of RAII styled locking class.
And consider using scoped_lock instead of lock_guard. Maybe we can use it now? (C++17)
Comment 3 Basuke Suzuki 2020-01-17 15:27:41 PST
Created attachment 388096 [details]
PATCH
Comment 4 Basuke Suzuki 2020-01-17 15:32:35 PST
A bug for scoped_lock was filed. https://bugs.webkit.org/show_bug.cgi?id=206451
Comment 5 Yusuke Suzuki 2020-01-17 15:42:01 PST
Comment on attachment 388096 [details]
PATCH

r=me
Comment 6 Basuke Suzuki 2020-01-17 16:39:34 PST
Thanks!
Comment 7 WebKit Commit Bot 2020-01-17 16:43:05 PST
Comment on attachment 388096 [details]
PATCH

Clearing flags on attachment: 388096

Committed r254781: <https://trac.webkit.org/changeset/254781>
Comment 8 WebKit Commit Bot 2020-01-17 16:43:07 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2020-01-17 16:44:19 PST
<rdar://problem/58700706>