(define (reset-glib-mutex!)
(set! glib-mutex (make-thread-mutex)))
-(define-integrable (with-glib-lock thunk)
+(define (with-glib-lock thunk)
(with-thread-mutex-lock glib-mutex thunk))
-(define-integrable-operator (without-glib-lock thunk)
- ;; Temporarily use thread-mutex-owner to (try to) avoid signaling an
- ;; error when glib is not locked. This should actually avoid the
- ;; error in single threaded worlds.
- (let ((owner (thread-mutex-owner glib-mutex)))
- (if (eq? #f owner)
- (begin
- (outf-error ";glib already unlocked\n")
- (thunk)
- ;; Lock it *now*?
- )
- (without-thread-mutex-lock glib-mutex thunk))))
+(define (without-glib-lock thunk)
+ (without-thread-mutex-lock glib-mutex thunk))
-(define-integrable (assert-glib-locked operator)
+#;(define-integrable (assert-glib-locked operator) #f)
+(define (assert-glib-locked operator)
;; Useful at least when debugging single threaded worlds.
(if (not (eq? (current-thread) (thread-mutex-owner glib-mutex)))
(outf-error ";glib not locked: "operator"\n")))
-(define-integrable (assert-without-interruption operator)
+#;(define-integrable (assert-without-interruption operator) #f)
+(define (assert-without-interruption operator)
(if (not (get-thread-event-block))
(outf-error ";not without-interruption: "operator"\n")))
(loop next prev))))))
(define (run-glib-daemons)
+ (assert-glib-locked 'run-glib-daemons)
(with-glib-error-handler "the secondary GC daemons"
trigger-secondary-gc-daemons!))
weak-pair))
(define (execute-glib-cleanup object)
- (assert-glib-locked 'execute-glib-cleanup) ; and without-interruption
+ (assert-without-interruption 'execute-glib-cleanup)
+ (assert-glib-locked 'execute-glib-cleanup)
(let ((entry (weak-assq object glib-cleanups)))
(if entry
(begin