WebKit Bugzilla
Attachment 373493 Details for
Bug 199516
: Add threading assertion to WTF::CompletionHandler
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP Patch
199516_wip.patch (text/plain), 993 bytes, created by
Chris Dumez
on 2019-07-05 08:21:22 PDT
(
hide
)
Description:
WIP Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-07-05 08:21:22 PDT
Size:
993 bytes
patch
obsolete
>diff --git a/Source/WTF/wtf/CompletionHandler.h b/Source/WTF/wtf/CompletionHandler.h >index fda54a6aad0..b296a4db932 100644 >--- a/Source/WTF/wtf/CompletionHandler.h >+++ b/Source/WTF/wtf/CompletionHandler.h >@@ -40,6 +40,7 @@ public: > template<typename CallableType, class = typename std::enable_if<std::is_rvalue_reference<CallableType&&>::value>::type> > CompletionHandler(CallableType&& callable) > : m_function(WTFMove(callable)) >+ , m_wasConstructedOnMainThread(isMainThread()) > { > } > >@@ -55,12 +56,14 @@ public: > > Out operator()(In... in) > { >+ RELEASE_ASSERT(m_wasConstructedOnMainThread == isMainThread()); // FIXME: Make it a debug ASSERT(). > ASSERT_WITH_MESSAGE(m_function, "Completion handler should not be called more than once"); > return std::exchange(m_function, nullptr)(std::forward<In>(in)...); > } > > private: > Function<Out(In...)> m_function; >+ bool m_wasConstructedOnMainThread; > }; > > namespace Detail {
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199516
:
373493
|
373497
|
373506
|
373509
|
373513
|
373514
|
373528
|
373530
|
373536
|
373549
|
373641