]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commit
Use fd signal trick to break us out of select; do not sigwait
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 30 Jul 2008 11:06:29 +0000 (12:06 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 30 Jul 2008 11:06:53 +0000 (12:06 +0100)
commitef9633e1290d055543136e136b6b7f59d863a601
tree44fba772bda7888c925a8883fa750a44f50daae3
parent1f153e0706851b43bb5c2083e531fd7b64b75be1
Use fd signal trick to break us out of select; do not sigwait

* The sigwait approach to detecting aio does not work because some
  versions of glibc forget to block signals on the private aio thread.
  This means that blocking SIGUSR2 is ineffective; the signals can be
  lost and the program can block in sigwait (!)

* Use of SIGUSR2 to interrupt select() does not work because signals
  which arrive just before entry to select() do not interrupt it.

So instead we use the time-honoured self-pipe trick: in the signal
handler we write to a pipe, which we select on when we want to wait
for the signal, and which we read from (to empty out) just before
actually doing the `top half' processing which deals with the condition
to which the signal relates.
block-raw-posix.c