Skip to content

Commit 6777288

Browse files
authored
Merge pull request #12383 from evedon/fix-thread_sleep_for-zero
Fix thread_sleep_for with zero wake_delay
2 parents da7c641 + ae57b43 commit 6777288

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

platform/source/mbed_os_timer.cpp

Lines changed: 3 additions & 1 deletion
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)