Re: Patch to add g_child_watch_source



Thus spake Jonathan Blandford:
> 
> Comments are appreciated,

(I should've sent this earlier - sorry)

> +static void
> +g_child_watch_signal_handler (int signum)
> +{
> +  child_watch_count ++;
> +  if (child_watch_init_state == CHILD_WATCH_INITIALIZED_THREADED)
> +    {
> +      write (child_watch_wake_up_pipe[1], "B", 1);
> +    }
> +  else
> +    {
> +      /* We count on the signal interrupting the poll in the same thread.
> +       */
> +    }
> +}

You probably want to use the same pipe trick even in the single-threaded
case, otherwise you won't notice the signal when it arrives between calls
to poll.

I don't think I understand what you're trying to protect with
child_watch_count...

There's also some cruft left in child_watch_helper_thread , where you
decided to use read instead of poll.

Hope this helps.

Alexis



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]