Changeset 6028


Ignore:
Timestamp:
Mar 12, 2007, 10:59:45 AM (13 years ago)
Author:
gb
Message:

class-wrapper-random-state: use encapsulation, and a lock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-clos-boot.lisp

    r5945 r6028  
    560560           spec)))
    561561
    562 (defglobal *class-wrapper-random-state* (make-random-state))
    563 
    564 (defun new-class-wrapper-hash-index ()
    565   ;; mustn't be 0
    566   (the fixnum (1+ (the fixnum (random target::target-most-positive-fixnum *class-wrapper-random-state*)))))
     562(let* ((class-wrapper-random-state (make-random-state))
     563       (class-wrapper-random-state-lock (make-lock)))
     564
     565  (defun  new-class-wrapper-hash-index ()
     566    ;; mustn't be 0
     567    (with-lock-grabbed (class-wrapper-random-state-lock)
     568      (the fixnum (1+ (the fixnum (random target::target-most-positive-fixnum class-wrapper-random-state)))))))
     569
    567570
    568571(defun %inner-method-function (method)
Note: See TracChangeset for help on using the changeset viewer.