Skip to content

Commit

Permalink
deadlock and video fix comments tidied
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth authored and Seth committed Feb 27, 2019
1 parent 537412b commit 1889560
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions BasiliskII/src/SDL/video_sdl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,8 @@ static int present_sdl_video()
SDL_SetRenderDrawColor(sdl_renderer, 0, 0, 0, 0); // Use black
SDL_RenderClear(sdl_renderer); // Clear the display

// We're about to work with sdl_update_video_rect, so stop other threads from
// modifying it!
LOCK_PALETTE;
SDL_LockMutex(sdl_update_video_mutex);
// Convert from the guest OS' pixel format, to the host OS' texture, if necessary.
Expand All @@ -890,11 +892,7 @@ static int present_sdl_video()
return -1;
}
}
UNLOCK_PALETTE;

// We're about to work with sdl_update_video_rect, so stop other threads from
// modifying it!
// SDL_LockMutex(sdl_update_video_mutex);
UNLOCK_PALETTE; // passed potential deadlock, can unlock palette

// Update the host OS' texture
void * srcPixels = (void *)((uint8_t *)host_surface->pixels +
Expand Down

0 comments on commit 1889560

Please sign in to comment.