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: Zhiyi Zhang <zzhang@codeweavers.com>
This commit is contained in:
parent
ed546bf190
commit
18ae96e5fb
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue