diff options
Diffstat (limited to 'src/rw-lock.lisp')
| -rw-r--r-- | src/rw-lock.lisp | 8 |
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%)) |