Add a function to query the name of a thread
This commit is contained in:
parent
c213413fb9
commit
230566830d
1 changed files with 6 additions and 1 deletions
|
|
@ -7,7 +7,7 @@
|
|||
(defpackage stoe.thread
|
||||
(:nicknames :thread)
|
||||
(:use :cl)
|
||||
(:export :make-thread :join-thread :thread-alive-p :current-thread
|
||||
(:export :make-thread :join-thread :thread-alive-p :current-thread :thread-name
|
||||
:make-mutex :grab-mutex :release-mutex
|
||||
:with-mutex :with-recursive-lock))
|
||||
(in-package :stoe.thread)
|
||||
|
|
@ -34,6 +34,11 @@ thread function."
|
|||
#+(and sbcl sb-thread) sb-thread:*current-thread*
|
||||
#-(and sbcl sb-thread) (error "For now, only sbcl is supported."))
|
||||
|
||||
(defun thread-name (thread)
|
||||
"Return the name of THREAD."
|
||||
#+(and sbcl sb-thread) (sb-thread:thread-name thread)
|
||||
#-(and sbcl sb-thread) (error "For now, only sbcl is supported."))
|
||||
|
||||
(defun make-mutex (&optional name)
|
||||
"Create a mutex."
|
||||
#+(and sbcl sb-thread) (sb-thread:make-mutex :name name)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue