diff --git a/events/EventQueue.cpp b/events/EventQueue.cpp index 4ed980f139..27c3a7a474 100644 --- a/events/EventQueue.cpp +++ b/events/EventQueue.cpp @@ -16,7 +16,6 @@ */ #include "events/EventQueue.h" #include "events/mbed_events.h" -#include "platform/mbed_assert.h" using mbed::Callback; @@ -72,12 +71,12 @@ void EventQueue::background(Callback update) } } -void EventQueue::chain(EventQueue *target) +int EventQueue::chain(EventQueue *target) { if (target) { - MBED_ASSERT(equeue_chain(&_equeue, &target->_equeue) == 0); + return equeue_chain(&_equeue, &target->_equeue); } else { - MBED_ASSERT(equeue_chain(&_equeue, 0) == 0); + return equeue_chain(&_equeue, 0); } } } diff --git a/events/EventQueue.h b/events/EventQueue.h index c5d7ef1f55..2b6b200a77 100644 --- a/events/EventQueue.h +++ b/events/EventQueue.h @@ -181,8 +181,11 @@ public: * * @param target Queue that will dispatch this queue's events as a * part of its dispatch loop + * + * @return Zero on success and negative error code value if chaining fails + * */ - void chain(EventQueue *target); + int chain(EventQueue *target);