Fix thread_sleep_for zero

pull/12383/head
Evelyne Donnaes 2020-02-06 15:19:18 +00:00
parent 8dc15ee6e1
commit ae57b4303e
1 changed files with 3 additions and 1 deletions

View File

@ -231,7 +231,9 @@ void do_timed_sleep_relative_or_forever(uint32_t wake_delay, bool (*wake_predica
{
// Special-case 0 delay, to save multiple callers having to do it. Just call the predicate once.
if (wake_delay == 0) {
wake_predicate(wake_predicate_handle);
if (wake_predicate) {
wake_predicate(wake_predicate_handle);
}
return;
}