+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (sb!xc:proclaim '(sb!ext:always-bound *current-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 nil :type (or thread-name null))
+ (%alive-p nil :type boolean)
+ (%ephemeral-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)
+ waiting-for)
+
+(def!struct (foreign-thread
+ (:include thread)
+ (:conc-name "THREAD-"))
+ #!+sb-doc
+ "Type of native threads which are attached to the runtime as Lisp threads
+temporarily.")
+
+#!+(and sb-safepoint-strictly (not win32))
+(def!struct (signal-handling-thread
+ (:include foreign-thread)
+ (:conc-name "THREAD-"))
+ #!+sb-doc
+ "Asynchronous signal handling thread."
+ (signal-number nil :type integer))
+