Skip to content

Commit 87c557c

Browse files
author
deepikabhavnani
committed
Return error in case chaining fails
1 parent 0385359 commit 87c557c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

events/EventQueue.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
#include "events/EventQueue.h"
1818
#include "events/mbed_events.h"
19-
#include "platform/mbed_assert.h"
2019

2120
using mbed::Callback;
2221

@@ -72,12 +71,12 @@ void EventQueue::background(Callback<void(int)> update)
7271
}
7372
}
7473

75-
void EventQueue::chain(EventQueue *target)
74+
int EventQueue::chain(EventQueue *target)
7675
{
7776
if (target) {
78-
MBED_ASSERT(equeue_chain(&_equeue, &target->_equeue) == 0);
77+
return equeue_chain(&_equeue, &target->_equeue);
7978
} else {
80-
MBED_ASSERT(equeue_chain(&_equeue, 0) == 0);
79+
return equeue_chain(&_equeue, 0);
8180
}
8281
}
8382
}

events/EventQueue.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
181181
*
182182
* @param target Queue that will dispatch this queue's events as a
183183
* part of its dispatch loop
184+
*
185+
* @return Zero on success and negative error code value if chaining fails
186+
*
184187
*/
185-
void chain(EventQueue *target);
188+
int chain(EventQueue *target);
186189

187190

188191

0 commit comments

Comments
 (0)