mirror of https://github.com/ARMmbed/mbed-os.git
Return error in case chaining fails
parent
03853597f5
commit
87c557c288
|
@ -16,7 +16,6 @@
|
||||||
*/
|
*/
|
||||||
#include "events/EventQueue.h"
|
#include "events/EventQueue.h"
|
||||||
#include "events/mbed_events.h"
|
#include "events/mbed_events.h"
|
||||||
#include "platform/mbed_assert.h"
|
|
||||||
|
|
||||||
using mbed::Callback;
|
using mbed::Callback;
|
||||||
|
|
||||||
|
@ -72,12 +71,12 @@ void EventQueue::background(Callback<void(int)> update)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventQueue::chain(EventQueue *target)
|
int EventQueue::chain(EventQueue *target)
|
||||||
{
|
{
|
||||||
if (target) {
|
if (target) {
|
||||||
MBED_ASSERT(equeue_chain(&_equeue, &target->_equeue) == 0);
|
return equeue_chain(&_equeue, &target->_equeue);
|
||||||
} else {
|
} else {
|
||||||
MBED_ASSERT(equeue_chain(&_equeue, 0) == 0);
|
return equeue_chain(&_equeue, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,8 +181,11 @@ public:
|
||||||
*
|
*
|
||||||
* @param target Queue that will dispatch this queue's events as a
|
* @param target Queue that will dispatch this queue's events as a
|
||||||
* part of its dispatch loop
|
* 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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue