change to srfi-27 for random bits

This commit is contained in:
interp 2002-09-18 15:32:41 +00:00
parent ac880e4491
commit 911c56e668
2 changed files with 20 additions and 22 deletions

View File

@ -71,20 +71,20 @@
(plugin-utilities plugin-utilities-interface))
(open httpd-responses
httpd-request
uri
tables ;hash-tables
define-record-types
uri ;URI-PATH-LIST->PATH
tables ;HASH-TABLES
define-record-types ;DEFINE-RECORD-TYPE
rt-module-language ;get structures dynamically
srfi-13
; srfi-13 ;string
srfi-14 ;CHAR-SET:DIGIT
handle-fatal-error
random ;not quite random
locks
thread-cells
profiling
httpd-logging
shift-reset
scsh
handle-fatal-error ;WITH-FATAL-ERROR-HANDLER* et al.
srfi-27 ;random numbers
locks ;MAKE-LOCK et al.
thread-cells ;THREAD-CELL et al.
profiling ;PROFILE-SPACE
httpd-logging ;HTTP-SYSLOG
shift-reset ;SHIFT and RESET
scsh ;regexp et al.
scheme
)
(files servlet-handler))
@ -149,6 +149,7 @@
spatial
srfi-13
srfi-1
locks
scsh
scheme)
(files profile))

View File

@ -2,14 +2,6 @@
;; Copyright Andreas Bernauer, 2002
;(define-record-type continuation-table-entry :continuation-table-entry
; (make-continuation-table-entry continuation)
; continuation-table-entry?
; (id continuation-table-entry-id set-continuation-table-entry-id!)
; (continuation continuation-table-entry-continuation
; set-continuation-table-entry-continuation!))
;;; instance-table: entry for every new request on a servlet page
(define-record-type instance :instance
(make-instance servlet-name continuation-table)
@ -29,8 +21,13 @@
;; FIXME: Make this thread-safe
(define *instance-table* (make-integer-table)) ; instance-id is index
(define random (make-random (modulo (time)268435455))) ; not really random
; generator
(define random
(let* ((source (make-random-source))
(random-integer (begin
(random-source-randomize! source)
(random-source-make-integers source))))
(lambda ()
(random-integer 1073741824)))) ; I hope, 1+ billion is enough....
(define (servlet-handler servlet-path)
(lambda (path req)