From c089a925b17301332cb5d70d473a3a58b4ff8672 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Wed, 18 Jan 2017 16:23:44 -0500 Subject: [PATCH] fix race condition when toggling menu with threaded_video on --- gfx/video_driver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 7146ed805b..34bed5063a 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -971,18 +971,22 @@ void video_driver_cached_frame_get(const void **data, unsigned *width, void video_driver_get_size(unsigned *width, unsigned *height) { + video_driver_threaded_lock(); if (width) *width = video_driver_width; if (height) *height = video_driver_height; + video_driver_threaded_unlock(); } void video_driver_set_size(unsigned *width, unsigned *height) { + video_driver_threaded_lock(); if (width) video_driver_width = *width; if (height) video_driver_height = *height; + video_driver_threaded_unlock(); } /**