Shanks0224 opened a new pull request, #4127: URL: https://github.com/apache/nuttx-apps/pull/4127
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary A thread that exits with a stream locked by `flockfile()` leaves the lock to the next thread that locks the stream. Add an ostest case that checks that the stream is unlocked once that thread unlocks it, so that another thread can lock it. The test uses its own stream (`fdopen(dup(1))`), so a failure does not block the output of ostest, and it is built when `CONFIG_FILE_STREAM` is set. depends-on: https://github.com/apache/nuttx/pull/22253 ## Impact New test only. Without apache/nuttx#NUTTX_PR the test reports an error. ## Testing Build host: Linux x86_64. `sim:nsh` + `CONFIG_TESTING_OSTEST`. Without apache/nuttx#NUTTX_PR: ``` user_main: flockfile test flockfile_test: Exiting a thread that holds the stream lock flockfile_test: Locking the stream from another thread flockfile_test: ERROR: the stream stayed locked ``` With it, `sim:nsh` and `qemu-armv8a:nsh` (QEMU): ``` user_main: flockfile test flockfile_test: Exiting a thread that holds the stream lock flockfile_test: Locking the stream from another thread ... ostest_main: Exiting with status 0 ``` Builds with Make and CMake with no warning. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
