master: Improve RELEASE-MUTEX docstring

snuglas via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  b0cdf28901ba559ead6699549ef21f4ac57a4dbb (commit)
      from  5c866b5159ffda6f3f83c67c47b50dd113d539e7 (commit)

- Log -----------------------------------------------------------------
commit b0cdf28901ba559ead6699549ef21f4ac57a4dbb
Author: Douglas Katzman <[email protected]>
Date:   Sun Apr 26 00:22:39 2026 -0400

    Improve RELEASE-MUTEX docstring
    
    "set it to NIL" may have made some sense over 20 years ago when a mutex
    was essentially just a container of one value, namely the owning thread.
---
 src/code/target-thread.lisp | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/code/target-thread.lisp b/src/code/target-thread.lisp
index a85478f3f..1f4db430a 100644
--- a/src/code/target-thread.lisp
+++ b/src/code/target-thread.lisp
@@ -981,17 +981,15 @@ Notes:
 
 (declaim (ftype (sfunction (mutex &key (:if-not-owner (member :punt :warn :error :force))) null)
                 release-mutex))
-(defun release-mutex (mutex &key (if-not-owner :punt))
-  "Release MUTEX by setting it to NIL. Wake up threads waiting for
-this mutex.
+(defun release-mutex (mutex &key (if-not-owner :punt)) ; TERRIBLE DEFAULT!!!
+  "Release MUTEX and wake up any other thread waiting for it.
 
 RELEASE-MUTEX is not interrupt safe: interrupts should be disabled
 around calls to it.
 
-If the current thread is not the owner of the mutex then it silently
-returns without doing anything (if IF-NOT-OWNER is :PUNT), signals a
-WARNING (if IF-NOT-OWNER is :WARN), or releases the mutex anyway (if
-IF-NOT-OWNER is :FORCE)."
+The IF-NOT-OWNER keyword dictates behavior when the current thread does not own the
+mutex. Do nothing and silently return if :PUNT, signal a WARNING or ERROR if :WARN
+or :ERROR respectively, or release the mutex anyway if :FORCE."
   (declare (type mutex mutex))
   ;; Order matters: set owner to NIL before releasing state.
   (let* ((self (current-vmthread-id))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.