Skip to content

Commit ae57b43

Browse files
committed
Fix thread_sleep_for zero
1 parent 8dc15ee commit ae57b43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

platform/source/mbed_os_timer.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ void do_timed_sleep_relative_or_forever(uint32_t wake_delay, bool (*wake_predica
231231
{
232232
// Special-case 0 delay, to save multiple callers having to do it. Just call the predicate once.
233233
if (wake_delay == 0) {
234-
wake_predicate(wake_predicate_handle);
234+
if (wake_predicate) {
235+
wake_predicate(wake_predicate_handle);
236+
}
235237
return;
236238
}
237239

0 commit comments

Comments
 (0)