From 80253ebcb2c548321936005628e6d042bb87a90f Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 2 Aug 2020 07:12:36 -0700 Subject: [PATCH] Throw an RAII lock around the conveyor to avoid a race condition --- TextCanvas.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TextCanvas.py b/TextCanvas.py index 842ce71..f012621 100644 --- a/TextCanvas.py +++ b/TextCanvas.py @@ -105,7 +105,8 @@ class TextCanvas: # So far simply does maintenance once per second while self.__conveyor_enabled is True: - self.__fps_samples.append(0) + with RAIILock(self.__lock): + self.__fps_samples.append(0) time.sleep(1)