diff options
| author | Marek Chalupa <mchqwerty@gmail.com> | 2014-08-12 11:35:06 +0200 |
|---|---|---|
| committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-08-18 13:03:00 +0300 |
| commit | f2338c8f3beb069d3fa7e4ba0d56be1cc6e065f5 (patch) | |
| tree | c4b0e653dd6c93bb141853569f4adbe491788bc4 /tests/event-loop-test.c | |
| parent | tests: make event-loop-test more explicit (diff) | |
| download | wayland-f2338c8f3beb069d3fa7e4ba0d56be1cc6e065f5.tar wayland-f2338c8f3beb069d3fa7e4ba0d56be1cc6e065f5.tar.gz wayland-f2338c8f3beb069d3fa7e4ba0d56be1cc6e065f5.tar.bz2 wayland-f2338c8f3beb069d3fa7e4ba0d56be1cc6e065f5.tar.lz wayland-f2338c8f3beb069d3fa7e4ba0d56be1cc6e065f5.tar.xz wayland-f2338c8f3beb069d3fa7e4ba0d56be1cc6e065f5.tar.zst wayland-f2338c8f3beb069d3fa7e4ba0d56be1cc6e065f5.zip | |
event-loop: make signalfd non-blocking
When we add more that one source to a signal, then wayland will
block in wl_event_loop_dispatch. This is due to the attampt to read
from signal's fd each time the source is dispatched.
wl_event_loop_add_signal(loop, SIGINT, ...);
wl_event_loop_add_signal(loop, SIGINT, ...);
/* raise signal .. */
/* we got two fd's ready, both for the one SIGINT */
epoll_wait(...) = 2
[ for (i == 0) ]
source1->dispatch() --> read(fd1);
[ for (i == 1) ]
source2->dispatch() --> read(fd2); /* blocking! */
Reading from fd2 will block, because we got only one signal,
and it was read from fd1.
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'tests/event-loop-test.c')
0 files changed, 0 insertions, 0 deletions
