From 23eefef91a9500df6910ed5887c94c7b9f9eb5dc Mon Sep 17 00:00:00 2001 From: gnosygnu Date: Mon, 16 Mar 2020 06:30:27 -0400 Subject: [PATCH] Log: Fix garbled messages still during HTML build [#646] --- 100_core/src/gplx/Gfo_usr_dlg__log_base.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/100_core/src/gplx/Gfo_usr_dlg__log_base.java b/100_core/src/gplx/Gfo_usr_dlg__log_base.java index 06b8f6576..a2cfba2a9 100644 --- a/100_core/src/gplx/Gfo_usr_dlg__log_base.java +++ b/100_core/src/gplx/Gfo_usr_dlg__log_base.java @@ -87,7 +87,9 @@ public class Gfo_usr_dlg__log_base implements Gfo_usr_dlg__log { catch (Exception e) {Err_.Noop(e);} // java.lang.StringBuilder can throw exceptions in some situations when called on a different thread; ignore errors } private String_bldr sb = String_bldr_.new_thread(); // NOTE: use java.lang.StringBuffer to try to avoid random exceptions when called on a different thread private String Bld_msg(String s) { - return sb.Add(Datetime_now.Get_force().XtoUtc().XtoStr_fmt_yyyyMMdd_HHmmss_fff()).Add(" ").Add(s).Add_char_nl().To_str_and_clear(); + synchronized (thread_lock) { // THREAD:synchronized neded b/c multiple threads can still mutate the same sb; ISSUE#:646; DATE:2020-03-16 + return sb.Add(Datetime_now.Get_force().XtoUtc().XtoStr_fmt_yyyyMMdd_HHmmss_fff()).Add(" ").Add(s).Add_char_nl().To_str_and_clear(); + } } private void Log_msg(Io_url url, String txt) { synchronized (thread_lock) { // THREAD:synchronized neded b/c queued_list can be accessible by multiple threads; ISSUE#:646; DATE:2020-01-09