mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #12941 from kjbracey-arm/chrono-timeout-fix
Correct Timeout reschedulingpull/12945/head mbed-os-6.0.0-beta-1
commit
1b2a68ae20
|
@ -27,11 +27,15 @@ namespace mbed {
|
||||||
void TimeoutBase::handler()
|
void TimeoutBase::handler()
|
||||||
{
|
{
|
||||||
if (_function) {
|
if (_function) {
|
||||||
|
Callback<void()> function_to_call = _function;
|
||||||
|
// Clean up state to "detached" before calling callback; it may attach
|
||||||
|
// a new callback. Equivalent to detach(), but skips the remove();
|
||||||
|
// it's unnecessary because we're in the ticker's handler.
|
||||||
|
_function = nullptr;
|
||||||
if (_lock_deepsleep) {
|
if (_lock_deepsleep) {
|
||||||
sleep_manager_unlock_deep_sleep();
|
sleep_manager_unlock_deep_sleep();
|
||||||
}
|
}
|
||||||
_function();
|
function_to_call();
|
||||||
_function = nullptr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue