From 9aa2ce1366b9d519e8a716e2bc8e5929bb6efeb1 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 15 Mar 2018 20:03:19 -0700 Subject: [PATCH] glib/glib-thread: Run-glib-daemons with glib lock. --- src/glib/glib-thread.scm | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/glib/glib-thread.scm b/src/glib/glib-thread.scm index a274c3b16..fc1939bc9 100644 --- a/src/glib/glib-thread.scm +++ b/src/glib/glib-thread.scm @@ -52,23 +52,22 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (done-tick 0) (next-secondary-tick secondary-gc-rate)) (let glib-thread-loop () - (let ((gc-tick (car (gc-timestamp)))) - (if (fix:< done-tick gc-tick) - (with-glib-lock - (lambda () - (%trace ";run-glib cleaning up\n") - (run-glib-cleanups) - (%trace ";run-glib clean up done\n") - (set! done-tick gc-tick)))) - (if (fix:< next-secondary-tick gc-tick) - (begin - (%trace ";run-glib secondary-gc daemons\n") - (run-glib-daemons) - (%trace ";run-glib secondary-gc daemons done\n") - (set! next-secondary-tick - (fix:+ gc-tick secondary-gc-rate))))) (with-glib-lock (lambda () + (let ((gc-tick (car (gc-timestamp)))) + (if (fix:< done-tick gc-tick) + (begin + (%trace ";run-glib cleaning up\n") + (run-glib-cleanups) + (%trace ";run-glib clean up done\n") + (set! done-tick gc-tick))) + (if (fix:< next-secondary-tick gc-tick) + (begin + (%trace ";run-glib secondary-gc daemons\n") + (run-glib-daemons) + (%trace ";run-glib secondary-gc daemons done\n") + (set! next-secondary-tick + (fix:+ gc-tick secondary-gc-rate))))) (with-thread-timer-stopped (lambda () (let ((time (or (and (thread/next self) 0) -- 2.25.1