Correct name of engine.rkt logger

This commit is contained in:
Tony Garnock-Jones 2021-06-08 15:57:25 +02:00
parent 19fc5f97bb
commit 92eab82b1f
1 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@
(require (only-in racket/exn exn->string)) (require (only-in racket/exn exn->string))
(require "support/counter.rkt") (require "support/counter.rkt")
(define-logger syndicate/task) (define-logger syndicate/engine)
(struct engine (id thread [inhabitant-count #:mutable]) (struct engine (id thread [inhabitant-count #:mutable])
#:methods gen:custom-write #:methods gen:custom-write
@ -27,10 +27,10 @@
(define e (engine (generate-engine-id) (define e (engine (generate-engine-id)
(thread (lambda () (thread (lambda ()
(thread-receive) ;; delay boot until we're ready (thread-receive) ;; delay boot until we're ready
(log-syndicate/task-debug "~a starting" e) (log-syndicate/engine-debug "~a starting" e)
(with-handlers ([exn? (handle-unexpected-task-runner-termination e)]) (with-handlers ([exn? (handle-unexpected-task-runner-termination e)])
(let loop () (let loop ()
(log-syndicate/task-debug (log-syndicate/engine-debug
"~a task count: ~a" e (engine-inhabitant-count e)) "~a task count: ~a" e (engine-inhabitant-count e))
(if (positive? (engine-inhabitant-count e)) (if (positive? (engine-inhabitant-count e))
;; We have some non-daemon users so just block ;; We have some non-daemon users so just block
@ -43,7 +43,7 @@
[thunk [thunk
(thunk) (thunk)
(loop)]))) (loop)])))
(log-syndicate/task-debug "~a stopping" e)))) (log-syndicate/engine-debug "~a stopping" e))))
initial-inhabitant-count)) initial-inhabitant-count))
(thread-send (engine-thread e) 'boot) (thread-send (engine-thread e) 'boot)
e) e)
@ -53,7 +53,7 @@
(set-engine-inhabitant-count! e (+ (engine-inhabitant-count e) delta))))) (set-engine-inhabitant-count! e (+ (engine-inhabitant-count e) delta)))))
(define ((handle-unexpected-task-runner-termination e) exn) (define ((handle-unexpected-task-runner-termination e) exn)
(log-syndicate/task-error "~a terminated unexpectedly!\n~a" e (exn->string exn)) (log-syndicate/engine-error "~a terminated unexpectedly!\n~a" e (exn->string exn))
(exit 1)) (exit 1))
(define (queue-task! e thunk) (define (queue-task! e thunk)