Skip to content
Commit d09bb138 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

In case a thread is doing a blocking operation (e.g. read()) on a serial

device, while it is being terminated by pthread_cancel(), then
uart_close() gets called, but the semaphore (dev->recv.sem in the above
example) is still blocked.

This means that once the serial device is opened next time, data will
arrive on the serial port (and driver interrupts handled as normal), but
the received characters never arrive in the reader thread.

This patch addresses the problem by re-initializing the semaphores on the
last uart_close() on the device.
parent 93bde18b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment