Skip to content

Commit de4ced3

Browse files
committed
Make poll() use wait(1) rather than yield()
Spinning while polling is overly CPU intensive, and inconsistent with the current blocking behaviour of UARTSerial. Change to use Thread::wait(1) to match UARTSerial.
1 parent b18332c commit de4ced3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

platform/mbed_poll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ int poll(pollfh fhs[], unsigned nfhs, int timeout)
6666
#ifdef MBED_CONF_RTOS_PRESENT
6767
// TODO - proper blocking
6868
// wait for condition variable, wait queue whatever here
69-
rtos::Thread::yield();
69+
rtos::Thread::wait(1);
7070
#endif
7171
}
7272
return count;

0 commit comments

Comments
 (0)