make log output correspond to what the user sees

svn: r4350
This commit is contained in:
Eli Barzilay 2006-09-16 04:49:07 +00:00
parent 7fa381cace
commit 92c5debbc1

View File

@ -606,17 +606,19 @@
(let loop ([timed-out? #f]) (let loop ([timed-out? #f])
(cond (cond
[(sync/timeout 3 session-thread) [(sync/timeout 3 session-thread)
(LOG "session killed ~awhile ~s" (let* ([status (unbox status-box)]
(if timed-out? "(timeout) " "") [status (if status
(unbox status-box)) (format " while ~a" status)
"")])
(LOG "session killed ~a~a"
(if timed-out? "(timeout) " "(memory)")
status)
(write+flush (write+flush
w (format "handin terminated due to ~a (program doesn't terminate?)~a" w (format "handin terminated due to ~a (program doesn't terminate?)~a"
(if timed-out? "time limit" "excessive memory use") (if timed-out? "time limit" "excessive memory use")
(if (unbox status-box) status))
(format " while ~a" (unbox status-box))
"")))
(close-output-port w) (close-output-port w)
(channel-put session-channel 'done)] (channel-put session-channel 'done))]
[(let ([t timeout]) ; grab value to avoid races [(let ([t timeout]) ; grab value to avoid races
(and t ((current-inexact-milliseconds) . > . t))) (and t ((current-inexact-milliseconds) . > . t)))
;; Shutdown here to get the handin-terminated error ;; Shutdown here to get the handin-terminated error