drivers/serial: fix race condition in multi-thread write

if multiple threads are doing serial read/write at the same time,
the driver will only wake up one of the thread, which will cause
other threads fail to be woken up in time and cause blocking

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-05-16 14:37:41 +08:00
committed by Alin Jerpelea
parent 23ad4700a9
commit 6be363ff35
6 changed files with 21 additions and 55 deletions
-2
View File
@@ -272,8 +272,6 @@ struct uart_dev_s
uint8_t open_count; /* Number of times the device has been opened */
uint8_t escape; /* Number of the character to be escaped */
volatile bool xmitwaiting; /* true: User waiting for space in xmit.buffer */
volatile bool recvwaiting; /* true: User waiting for data in recv.buffer */
#ifdef CONFIG_SERIAL_REMOVABLE
volatile bool disconnected; /* true: Removable device is not connected */
#endif