[PATCH xserver] config: Hold input lock across udev socket handling

Peter Hutterer peter.hutterer at who-t.net
Tue Aug 16 08:02:31 UTC 2016


On Mon, Aug 15, 2016 at 10:25:56PM -0700, Keith Packard wrote:
> This avoids having the server running inside libudev from two threads
> at once, which it appears to not like.
> 
> Signed-off-by: Keith Packard <keithp at keithp.com>

Thanks, much appreciated

   de5291c..bf2ca50  master -> master

Cheers,
   Peter

> ---
>  config/udev.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/config/udev.c b/config/udev.c
> index 23b795f..932f230 100644
> --- a/config/udev.c
> +++ b/config/udev.c
> @@ -345,9 +345,12 @@ socket_handler(int fd, int ready, void *data)
>      struct udev_device *udev_device;
>      const char *action;
>  
> +    input_lock();
>      udev_device = udev_monitor_receive_device(udev_monitor);
> -    if (!udev_device)
> +    if (!udev_device) {
> +        input_unlock();
>          return;
> +    }
>      action = udev_device_get_action(udev_device);
>      if (action) {
>          if (!strcmp(action, "add")) {
> @@ -364,6 +367,7 @@ socket_handler(int fd, int ready, void *data)
>              device_removed(udev_device);
>      }
>      udev_device_unref(udev_device);
> +    input_unlock();
>  }
>  
>  int
> -- 
> 2.8.1
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list