]> granicus.if.org Git - esp-idf/commit
vfs_uart: fix write operation blocked by a read
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 29 Aug 2017 00:23:40 +0000 (08:23 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 29 Aug 2017 00:27:36 +0000 (08:27 +0800)
commit13ef3938a634be9b209300e751ec996a2f0b402a
treeac352677559f25357099eab96ba8771f088064f4
parent3161854efbd3ff966c3adbf06c8ed8558eadbb5f
vfs_uart: fix write operation blocked by a read

vfs_uart used same locks for read and write operations on a single UART.
If read operation was blocking (i.e. carried out via UART driver), the
lock was held by reading task until it received a line. During this time,
other tasks trying to write to the same UART would get blocked.

This change introduces separate read/write locks, and adds a test.

Another vfs_uart test if fixed (it was disabled since the
CONFIG_NEWLIB_STDOUT_ADDCR option was removed).
components/vfs/test/test_vfs_uart.c
components/vfs/vfs_uart.c