Add bang after set-... commands.

This commit is contained in:
interp 2003-01-17 17:47:31 +00:00
parent 05b7af0986
commit 4183ec85ce
1 changed files with 12 additions and 11 deletions

View File

@ -20,9 +20,9 @@
(define-record-type state :state
(make-state file-name file-names-to-delete counter)
state?
(file-name state:file-name set-state:file-name)
(file-names-to-delete state:file-names-to-delete set-state:file-names-to-delete)
(counter state:counter set-state:counter))
(file-name state:file-name set-state:file-name!)
(file-names-to-delete state:file-names-to-delete set-state:file-names-to-delete!)
(counter state:counter set-state:counter!))
(define (state-file-name)
(state:file-name (get-servlet-data)))
@ -30,7 +30,7 @@
(state:file-names-to-delete (get-servlet-data)))
(define (state-counter)
(state:counter (get-servlet-data)))
;; Leave this global. Servers are running on a single system.
(define gnuplot #f) ;; Set in main.
(define lock (make-lock))
@ -112,7 +112,7 @@
(profile-space (state:file-name state))
(release-lock lock)
(format #t "profile recorded in ~s~%" (state:file-name state))
(set-state:counter state (+ 1 (state:counter state)))
(set-state:counter! state (+ 1 (state:counter state)))
(profile req (format #f "Profile #~a generated" (state:counter state)))))
(define (result req)
@ -200,24 +200,25 @@ plot '~a' title 'Servlet Profiling ~a' with lines"
(define (add-file-name-to-delete! file-name)
(let ((state (get-servlet-data)))
(set-state:file-names-to-delete
(set-state:file-names-to-delete!
state
(cons file-name
(state:file-names-to-delete state)))))
(define (delete-files state)
(format #t "running delete-files with state ~a~%" (state:file-names-to-delete state))
(let ((file-names-to-delete (state:file-names-to-delete state)))
(if file-names-to-delete
(for-each delete-filesys-object file-names-to-delete))))
(define (reset-profiling-state!)
(let ((state (get-servlet-data)))
(set-state:counter state 0)
(set-state:counter! state 0)
(delete-files state)
(set-state:file-name state
(absolute-file-name (create-temp-file "servlet-profiling")))
(set-state:file-names-to-delete state
(list (state:file-name state)))))
(set-state:file-name! state
(absolute-file-name (create-temp-file "servlet-profiling")))
(set-state:file-names-to-delete! state
(list (state:file-name state)))))
(define (reset-and-return-to-main-page req)
;; Overhead included :-|