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.
pull/5216/head
Kevin Bracey 2017-10-02 09:59:24 +03:00
parent b18332cb4d
commit de4ced33a6
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ int poll(pollfh fhs[], unsigned nfhs, int timeout)
#ifdef MBED_CONF_RTOS_PRESENT
// TODO - proper blocking
// wait for condition variable, wait queue whatever here
rtos::Thread::yield();
rtos::Thread::wait(1);
#endif
}
return count;