zephyr/lib
Marcin Niestroj 063dd51dc7 lib: posix: eventfd: fix read/poll after multiple writes
So far semaphore was used with possible values in range 0 to
UINT32_MAX. Each write resulted in semaphore increment. As an example
after two writes and single read eventfd counter was correctly zeroed,
but semaphore counter was not. This means that poll() signalled at this
stage POLLIN (semaphore counter was > 0), but it clearly should
not (eventfd counter == 0). Blocking version of read() was also
returning immediately, returning 0 as previous eventfd counter.

Change read_sem to be a binary semaphore, which counter represents
eventfd counter being zero (when semaphore counter == 0) or
non-zero (when semaphore counter == 1). Try to take the semaphore in
eventfd read() and decrement eventfd counter when semaphore was ready.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-20 16:21:37 +02:00
..
cmsis_rtos_v1 zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
cmsis_rtos_v2 zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
fnmatch ext: lib: Move fnmatch to lib/ 2020-03-20 22:56:19 -04:00
gui zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
libc libc: malloc: log an error when malloc is called and arena size is 0 2020-07-20 12:48:33 +02:00
open-amp lib: open-amp: add helper to add resource table in project 2020-04-01 09:21:15 -05:00
os lib/os/heap: remove big_heap restriction for aligned allocations 2020-07-14 19:35:52 -04:00
posix lib: posix: eventfd: fix read/poll after multiple writes 2020-07-20 16:21:37 +02:00
updatehub lib: updatehub: Add download block check 2020-06-23 19:22:31 +02:00
CMakeLists.txt lib: open-amp: add helper to add resource table in project 2020-04-01 09:21:15 -05:00
Kconfig lib: open-amp: add helper to add resource table in project 2020-04-01 09:21:15 -05:00