mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-06-12 04:29:29 +00:00
Moving SDL video mutex lock to avoid deadlock between buffering and drawing threads
This commit is contained in:
parent
f67fe9671b
commit
d9ba646899
|
@ -1094,12 +1094,10 @@ void driver_base::update_palette(void)
|
||||||
|
|
||||||
if ((int)VIDEO_MODE_DEPTH <= VIDEO_DEPTH_8BIT) {
|
if ((int)VIDEO_MODE_DEPTH <= VIDEO_DEPTH_8BIT) {
|
||||||
SDL_SetSurfacePalette(s, sdl_palette);
|
SDL_SetSurfacePalette(s, sdl_palette);
|
||||||
SDL_LockMutex(sdl_update_video_mutex);
|
|
||||||
sdl_update_video_rect.x = 0;
|
sdl_update_video_rect.x = 0;
|
||||||
sdl_update_video_rect.y = 0;
|
sdl_update_video_rect.y = 0;
|
||||||
sdl_update_video_rect.w = VIDEO_MODE_X;
|
sdl_update_video_rect.w = VIDEO_MODE_X;
|
||||||
sdl_update_video_rect.h = VIDEO_MODE_Y;
|
sdl_update_video_rect.h = VIDEO_MODE_Y;
|
||||||
SDL_UnlockMutex(sdl_update_video_mutex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2514,6 +2512,7 @@ static inline void possibly_ungrab_mouse()
|
||||||
|
|
||||||
static inline void handle_palette_changes(void)
|
static inline void handle_palette_changes(void)
|
||||||
{
|
{
|
||||||
|
SDL_LockMutex(sdl_update_video_mutex);
|
||||||
LOCK_PALETTE;
|
LOCK_PALETTE;
|
||||||
|
|
||||||
if (sdl_palette_changed) {
|
if (sdl_palette_changed) {
|
||||||
|
@ -2522,6 +2521,7 @@ static inline void handle_palette_changes(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
UNLOCK_PALETTE;
|
UNLOCK_PALETTE;
|
||||||
|
SDL_UnlockMutex(sdl_update_video_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void video_refresh_window_static(void);
|
static void video_refresh_window_static(void);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user