Commit 18ae96e5 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

winex11.drv: Lock display when expecting error events.

If the display is not locked, another thread could take the error event and handle it with the default error handlers and thus not handled by the current thread with the specified error handlers. Fix Cladun X2 crash at start. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com>
parent ed546bf1
......@@ -273,6 +273,7 @@ static inline BOOL ignore_error( Display *display, XErrorEvent *event )
void X11DRV_expect_error( Display *display, x11drv_error_callback callback, void *arg )
{
pthread_mutex_lock( &error_mutex );
XLockDisplay( display );
err_callback = callback;
err_callback_display = display;
err_callback_arg = arg;
......@@ -291,6 +292,7 @@ int X11DRV_check_error(void)
{
int res = err_callback_result;
err_callback = NULL;
XUnlockDisplay( err_callback_display );
pthread_mutex_unlock( &error_mutex );
return res;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment