X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fthread.lisp;h=7a2e567a02526a78193f3eeff1847a4e33028811;hb=d3af5593ffff1c39a2f8fa8113704803f347e22f;hp=dc92196257be4990de42db47c265501dae8b744e;hpb=c553e4be6da2d18f0827f190589c88e837b8b8a6;p=sbcl.git diff --git a/src/code/thread.lisp b/src/code/thread.lisp index dc92196..7a2e567 100644 --- a/src/code/thread.lisp +++ b/src/code/thread.lisp @@ -11,25 +11,32 @@ (in-package "SB!THREAD") +(def!type thread-name () + 'simple-string) + (def!struct (thread (:constructor %make-thread)) #!+sb-doc "Thread type. Do not rely on threads being structs as it may change in future versions." - name - %alive-p - os-thread - interruptions - (interruptions-lock (make-mutex :name "thread interruptions lock")) - result - (result-lock (make-mutex :name "thread result lock"))) + (name nil :type (or thread-name null)) + (%alive-p nil :type boolean) + (os-thread nil :type (or integer null)) + (interruptions nil :type list) + (result nil :type list) + (interruptions-lock + (make-mutex :name "thread interruptions lock") + :type mutex) + (result-lock + (make-mutex :name "thread result lock") + :type mutex)) (def!struct mutex #!+sb-doc "Mutex type." - (name nil :type (or null simple-string)) + (name nil :type (or null thread-name)) (%owner nil :type (or null thread)) #!+(and (not sb-lutex) sb-thread) - (state 0 :type fixnum) + (state 0 :type fixnum) #!+(and sb-lutex sb-thread) (lutex (make-lutex))) @@ -60,7 +67,7 @@ stale value, use MUTEX-OWNER instead." (def!struct spinlock #!+sb-doc "Spinlock type." - (name nil :type (or null simple-string)) + (name nil :type (or null thread-name)) (value nil)) (sb!xc:defmacro with-mutex ((mutex &key (value '*current-thread*) (wait-p t))