From 5ccf7e6a4777b52b5cc80f52fb1746fd181c40bb Mon Sep 17 00:00:00 2001 From: Kartik Singh Date: Wed, 6 Dec 2023 11:40:49 -0500 Subject: [PATCH] Use SB-THREAD mutex for handle lock (#52) --- sbcl-librarian.asd | 1 - src/handles.lisp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sbcl-librarian.asd b/sbcl-librarian.asd index bca484a2..9d8db5ba 100644 --- a/sbcl-librarian.asd +++ b/sbcl-librarian.asd @@ -3,7 +3,6 @@ (asdf:defsystem #:sbcl-librarian :description "Tool for generating Lisp bindings." :author "Charles Zhang " - :depends-on (#:bordeaux-threads) ; :license "TODO" ; :version "0.0.1" :in-order-to ((test-op (test-op "sbcl-librarian/tests"))) diff --git a/src/handles.lisp b/src/handles.lisp index 49b815df..899efa5e 100644 --- a/src/handles.lisp +++ b/src/handles.lisp @@ -11,10 +11,10 @@ (defun handle-key (handle) (sb-alien::sap-int (sb-alien:alien-sap handle))) (defvar *handle-lock* - (bt:make-lock "handle lock")) + (sb-thread:make-mutex :name "handle lock")) (defun make-handle (object) - (bt:with-lock-held (*handle-lock*) + (sb-thread:with-mutex (*handle-lock*) (let* ((handles *handles*) (key (svref handles 1))) (setf (gethash key (svref handles 0)) object)