diff --git a/autowiring/DispatchQueue.h b/autowiring/DispatchQueue.h index 6976a11c8..22d0b0a5d 100644 --- a/autowiring/DispatchQueue.h +++ b/autowiring/DispatchQueue.h @@ -356,7 +356,7 @@ class DispatchQueue { /// Generic overload which will pend an arbitrary dispatch type /// template - void operator+=(_Fx&& fx) { + bool operator+=(_Fx&& fx) { static_assert(!std::is_base_of::value, "Overload resolution malfunction, must not doubly wrap a dispatch thunk"); static_assert(!std::is_pointer<_Fx>::value, "Cannot pend a pointer to a function, we must have direct ownership"); @@ -367,7 +367,7 @@ class DispatchQueue { if (m_count >= m_dispatchCap) { m_dispatchLock.unlock(); delete thunk; - return; + return false; } // Count must be separately maintained: @@ -387,5 +387,6 @@ class DispatchQueue { // Notification as needed: OnPended(std::unique_lock{}); + return true; } };