dinput: Lock around polling a HID device in joystick_osx.
commit5853f356b8f0ede9a38f7833cdfe0806b84aa9bd
authorTim Clem <tclem@codeweavers.com>
Wed, 29 Sep 2021 20:01:54 +0000 (29 13:01 -0700)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 30 Sep 2021 08:16:05 +0000 (30 10:16 +0200)
tree1a851f0edf38d831652d2933b52a7bd03ab36362
parentc52645807bf0f4984381397d9d8ec279619d1bfa
dinput: Lock around polling a HID device in joystick_osx.

If multiple threads try to read IOHIDElements and IOHIDValues from
the same IOHIDDevice simultaneously, we sometimes crash deep in
IOKit.

Fixes a crash in GTA 4 when using a PS4 controller.

Signed-off-by: Tim Clem <tclem@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/dinput/joystick_osx.c