Bug 206443 - [bmalloc] Define alias for std::unique_lock and std::lock_guard for better readability
Summary: [bmalloc] Define alias for std::unique_lock and std::lock_guard for better re...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: bmalloc (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-17 14:07 PST by Basuke Suzuki
Modified: 2020-01-17 16:44 PST (History)
6 users (show)

See Also:


Attachments
PATCH (71.34 KB, patch)
2020-01-17 14:14 PST, Basuke Suzuki
ysuzuki: review-
Details | Formatted Diff | Diff
PATCH (72.43 KB, patch)
2020-01-17 15:27 PST, Basuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>