Skip to content

Commit

Permalink
Chore: update to bordeaux-threads-2 (#74)
Browse files Browse the repository at this point in the history
Update prng to bt2.
  • Loading branch information
kilianmh authored Aug 13, 2024
1 parent f82d425 commit 99f0a32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/prng/os-prng.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
#+unix
(defparameter *os-prng-stream* nil)
#+unix
(defparameter *os-prng-stream-lock* (bt:make-lock))
(defparameter *os-prng-stream-lock* (bt2:make-lock))

(defclass os-prng ()
())

(defmethod prng-random-data (num-bytes (prng os-prng))
#+unix
(let* ((seq (make-array num-bytes :element-type '(unsigned-byte 8)))
(n (bt:with-lock-held (*os-prng-stream-lock*)
(n (bt2:with-lock-held (*os-prng-stream-lock*)
(unless (and *os-prng-stream* (open-stream-p *os-prng-stream*))
(setf *os-prng-stream* (open #P"/dev/urandom"
#+ccl :sharing #+ccl :external
Expand Down Expand Up @@ -67,4 +67,4 @@

(setf *prng* (make-prng :os))
#+thread-support
(pushnew '(*prng* . (make-prng :os)) bt:*default-special-bindings* :test #'equal)
(pushnew '(*prng* . (make-prng :os)) bt2:*default-special-bindings* :test #'equal)

0 comments on commit 99f0a32

Please sign in to comment.