From f06029a3889734491909ebe99b5041529d9b8944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Thu, 20 Apr 2023 18:59:10 -0400 Subject: [PATCH] Add TODO comment for cvstat. When originally created, it was intended to be accessed only by a single thread, and therefore not need mutex protection, allowing less code to run with vstatlock held. Unfortunately, this is not how it turned out, so cvstat should either be removed, or it should actually be cleaned up to work as intended. --- src/conio/sdl_con.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/conio/sdl_con.c b/src/conio/sdl_con.c index e1eb3c49e2..1e36b4697a 100644 --- a/src/conio/sdl_con.c +++ b/src/conio/sdl_con.c @@ -65,6 +65,17 @@ pthread_mutex_t sdl_keylock; sem_t sdl_key_pending; static unsigned int sdl_pending_mousekeys=0; +/* + * TODO: + * The intent of this was a copy of current vstat that + * does not require vstatlock to be held. + * + * Unfortunately, this is accessed from multiple threads + * currently (at least main and video events), so it + * requires *a* lock, and vstatlock is used for that purpose. + * This should either have its own lock, or be used *only* + * from a single thread. + */ static struct video_stats cvstat; struct sdl_keyvals { -- GitLab