WebKit Bugzilla
Attachment 350003 Details for
Bug 189691
: Use Box<BinarySemaphore> instead of dispatch_semaphore_t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189691-20180918150529.patch (text/plain), 2.30 KB, created by
Yusuke Suzuki
on 2018-09-17 23:05:30 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-09-17 23:05:30 PDT
Size:
2.30 KB
patch
obsolete
>Subversion Revision: 236101 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 1de0fa0d945210ed781fa7fe64ad9a849418d11c..12669ef2d676c8f10a8776756deeb9bbe22a0edb 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2018-09-17 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use Box<BinarySemaphore> instead of dispatch_semaphore_t >+ https://bugs.webkit.org/show_bug.cgi?id=189691 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use Box<BinarySemaphore> instead, which utilizes our WTF::Lock mechanism. >+ >+ * NetworkProcess/watchos/NetworkProximityManager.mm: >+ (WebKit::NetworkProximityManager::updateRecommendation): >+ > 2018-09-17 Yusuke Suzuki <utatane.tea@gmail.com> > > [WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t >diff --git a/Source/WebKit/NetworkProcess/watchos/NetworkProximityManager.mm b/Source/WebKit/NetworkProcess/watchos/NetworkProximityManager.mm >index 33c9e2c7ca6c27c181f905deaabb3e5630bb7ec5..66facf3c4a3d71c24558c0b13ff86dd481347e37 100644 >--- a/Source/WebKit/NetworkProcess/watchos/NetworkProximityManager.mm >+++ b/Source/WebKit/NetworkProcess/watchos/NetworkProximityManager.mm >@@ -35,8 +35,10 @@ > #import <WirelessCoexManager/WRM_iRATInterface.h> > #import <pal/spi/cf/CFNetworkSPI.h> > #import <wtf/BlockPtr.h> >+#import <wtf/Box.h> > #import <wtf/CompletionHandler.h> > #import <wtf/cf/TypeCastsCF.h> >+#import <wtf/threads/BinarySemaphore.h> > > WTF_DECLARE_CF_TYPE_TRAIT(SCNetworkInterface); > >@@ -298,13 +300,12 @@ void NetworkProximityManager::updateRecommendation() > > RELEASE_LOG(ProximityNetworking, "Requesting an immediate recommendation from iRATManager."); > >- auto semaphore = adoptOSObject(dispatch_semaphore_create(0)); >+ auto semaphore = Box<BinarySemaphore>::create(); > [m_iRATInterface getProximityLinkRecommendation:NO recommendation:[this, semaphore](NSArray<WRM_iRATProximityRecommendation *> *recommendations) { > processRecommendations(recommendations); >- dispatch_semaphore_signal(semaphore.get()); >+ semaphore->signal(); > }]; >- >- dispatch_semaphore_wait(semaphore.get(), dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC)); >+ semaphore->waitFor(1_s); > } > > void NetworkProximityManager::initialize(const NetworkProcessCreationParameters& parameters)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
rniwa
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189691
: 350003