From b15275dcf5a2c25274977e6d8e6300f0d83385cb Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Wed, 24 Apr 2024 14:07:00 +0200 Subject: [PATCH] (#2895) Make setting Progress value thread-safe --- WebApp/src/uk/ac/exeter/QuinCe/web/Progress.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/WebApp/src/uk/ac/exeter/QuinCe/web/Progress.java b/WebApp/src/uk/ac/exeter/QuinCe/web/Progress.java index 74c9ea707..5524822e1 100644 --- a/WebApp/src/uk/ac/exeter/QuinCe/web/Progress.java +++ b/WebApp/src/uk/ac/exeter/QuinCe/web/Progress.java @@ -57,11 +57,15 @@ public void setMax(float max) { * The value. */ public void setValue(float value) { - this.value = value; + synchronized (this) { + this.value = value; + } } public void increment() { - this.value += 1; + synchronized (this) { + this.value += 1; + } } /**