]> git.alsa-project.org Git - alsa-gobject.git/commit
timer: user-instance: add an argument for open(2) flag into API to open ALSA timer...
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 10 Feb 2020 08:04:09 +0000 (17:04 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Tue, 11 Feb 2020 12:01:11 +0000 (21:01 +0900)
commit36487c5e54eb1fcf9384719b7cbabfc31cba83fd
tree3a5b4c56e40ffadb6ad16ca7ef165ce6bf6dcc7e
parentb911ef0b2f27427b7c1aafd982adfc411ebbe57e
timer: user-instance: add an argument for open(2) flag into API to open ALSA timer character device

As long as using the created Gsource with GMainContext, the call of poll(2)
system call with infinite timeout surely returns when quit() method is
called for the context. All of GMainContext implements GWakeup with eventfd
and the call of quit() emits event via file descriptor of eventfd. This
brings wakeup from blocking when poll(2) is called with inifinite timeout.
This means that it's safe for event polling without O_NONBLOCK.

On the other hand, there are many options for file descriptors; e.g.
O_APPEND and O_CLOEXEC. For the case, glib framework has no support.

This commit adds an argument for the open flags.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/timer/user-instance.c
src/timer/user-instance.h