[Scummvm-git-logs] scummvm master -> 71ad316f1fc51e4beaa5fd3ed1814c849b245efc

spleen1981 noreply at scummvm.org
Thu Mar 23 22:36:54 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
71ad316f1f LIBRETRO: fix thread switch threshold


Commit: 71ad316f1fc51e4beaa5fd3ed1814c849b245efc
    https://github.com/scummvm/scummvm/commit/71ad316f1fc51e4beaa5fd3ed1814c849b245efc
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-03-23T23:36:16+01:00

Commit Message:
LIBRETRO: fix thread switch threshold

Changed paths:
    backends/platform/libretro/src/libretro-os.cpp


diff --git a/backends/platform/libretro/src/libretro-os.cpp b/backends/platform/libretro/src/libretro-os.cpp
index aa9811eb399..a9d05691c58 100644
--- a/backends/platform/libretro/src/libretro-os.cpp
+++ b/backends/platform/libretro/src/libretro-os.cpp
@@ -642,13 +642,11 @@ public:
 	}
 
 	void retroCheckThread(uint32 offset = 0) {
-		uint32 now = getMillis();
-
 		/* Limit the thread switches triggered by pollEvent or delayMillis to one each 10ms.
 		   Do not limit thread switches due to consecutive updateScreen to avoid losing frames. */
-		if (_threadExitTime <= (now + offset)) {
-			_threadExitTime = now + 10;
+		if (_threadExitTime <= (getMillis() + offset)) {
 			retro_switch_to_main_thread();
+			_threadExitTime = getMillis() + 10;
 		} else if (_threadSwitchCaller & THREAD_SWITCH_UPDATE){
 			retro_switch_to_main_thread();
 		}




More information about the Scummvm-git-logs mailing list