commit | 0df7bd26eddd57d6cc9bd23237964a3d71f6f8ac | [log] [tgz] |
---|---|---|
author | Jaxson Han <jaxson.han@arm.com> | Mon Jul 10 22:04:05 2023 +0800 |
committer | Carles CufĂ <carles.cufi@nordicsemi.no> | Wed Jul 12 09:25:26 2023 +0200 |
tree | ffccfb56fbcfd7a1aded7ae75038d845fd88f7e6 | |
parent | 8fd1ce7579d3c21b724365826e3e9c834d7a327e [diff] |
lib: posix: pthread_rwlock: Fix a racy issue Multiple reader threads unlocking the read lock simultaneously might cause the program hang because it's possible that no thread is identified as the last one to active the writer thread. To fix the issue, swap the k_sem_give sequence. Signed-off-by: Jaxson Han <jaxson.han@arm.com>