summaryrefslogtreecommitdiff
path: root/src/rw-lock.lisp
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2025-10-24 08:09:46 +0300
committerGravatar Uko Kokņevičs2025-10-24 08:09:46 +0300
commit69d775b3d3a8f5bdb920630c7bdf6ec1b264b203 (patch)
tree8e9be882f3d690abed0f37e9a29c9dfd7686e9e8 /src/rw-lock.lisp
parentUpdate f-string (diff)
downloadukkoclot-69d775b3d3a8f5bdb920630c7bdf6ec1b264b203.tar.gz
ukkoclot-69d775b3d3a8f5bdb920630c7bdf6ec1b264b203.tar.xz
ukkoclot-69d775b3d3a8f5bdb920630c7bdf6ec1b264b203.zip
Configure a custom readtable explicitly
Diffstat (limited to 'src/rw-lock.lisp')
-rw-r--r--src/rw-lock.lisp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rw-lock.lisp b/src/rw-lock.lisp
index b8d08b1..2a5e2c3 100644
--- a/src/rw-lock.lisp
+++ b/src/rw-lock.lisp
@@ -4,10 +4,12 @@
4 (:documentation "Implementation of a shared/read-write lock.") 4 (:documentation "Implementation of a shared/read-write lock.")
5 (:use :c2cl :bt2 :iterate) 5 (:use :c2cl :bt2 :iterate)
6 (:import-from :alexandria :whichever :with-gensyms) 6 (:import-from :alexandria :whichever :with-gensyms)
7 (:import-from :com.dieggsy.f-string :enable-f-strings) 7 (:import-from :named-readtables :in-readtable)
8 ;; These imports make this SBCL-dependent, but technically speaking we could live without them.
8 (:import-from :sb-sys 9 (:import-from :sb-sys
9 :allow-with-interrupts :with-local-interrupts :without-interrupts) 10 :allow-with-interrupts :with-local-interrupts :without-interrupts)
10 (:import-from :serapeum :->) 11 (:import-from :serapeum :->)
12 (:import-from :ukkoclot/src/readtable :readtable)
11 (:export 13 (:export
12 #:rw-lock 14 #:rw-lock
13 #:rw-lock-p 15 #:rw-lock-p
@@ -19,9 +21,7 @@
19 #:release-write-lock 21 #:release-write-lock
20 #:with-write-lock)) 22 #:with-write-lock))
21(in-package :ukkoclot/src/rw-lock) 23(in-package :ukkoclot/src/rw-lock)
22 24(in-readtable readtable)
23(eval-when (:compile-toplevel :load-toplevel :execute)
24 (enable-f-strings))
25 25
26;; TODO: Use atomic-integer in best-case for read locks to decrease contention 26;; TODO: Use atomic-integer in best-case for read locks to decrease contention
27(defstruct (rw-lock (:constructor make-rw-lock%)) 27(defstruct (rw-lock (:constructor make-rw-lock%))