Signal an error in unlock-thread-mutex when mutex is not owned,
authorMatt Birkholz <matt@birchwood-abbey.net>
Tue, 5 Jun 2018 07:22:28 +0000 (00:22 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Tue, 5 Jun 2018 07:22:28 +0000 (00:22 -0700)
before applying remove-thread-mutex! to #f, which produces a less
helpful error message.

src/runtime/thread.scm

index 5ea1867f924ad50cdc8f579d55c367c8e74a35d7..693aacd28ad626ff5abfa8610f925d6a68cfb38d 100644 (file)
@@ -1211,7 +1211,8 @@ USA.
   (without-interrupts
    (lambda ()
      (let ((owner (thread-mutex/owner mutex)))
-       (if (and owner (not (eq? owner (current-thread))))
+       (if (or (not owner)
+              (not (eq? owner (current-thread))))
           (error "Don't own mutex:" mutex))
        (%unlock-thread-mutex mutex owner)))))