From b4a4b2f554ce4c4ebc174a977390f4ee84d0ef6f Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Mon, 20 Apr 2026 18:31:21 +0200 Subject: [PATCH] mutex implemented for callback to racket. Needs to be serialized and protected. --- rktwebview.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rktwebview.cpp b/rktwebview.cpp index 7dcf49b..98ae765 100644 --- a/rktwebview.cpp +++ b/rktwebview.cpp @@ -313,6 +313,12 @@ void rkt_webview_cleanup() handler->verbose = true; handler->event_queue->enqueue(EVT_NULL); + + // I finally found out that this second is not important. + // The call to racket must be in a mutex in order to make sure + // this side of the library isn't cleaned before the asynchronous + // racket call returns. We need to serialize it. This has now + // been done using the evt_cb_mutex. //sleep_ms(1000); // Why is this second so important? // I just don't get why the evt_guard thread is blocking and getting core dumped // on the thread join, if this second is not given