Avoid use of private typedefs
[sbcl.git] / src / code / early-thread.lisp
blobb0d8d5dd678443b140e37a887f75dcfe4189a919
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
10 (in-package "SB!THREAD")
12 (eval-when (:compile-toplevel :load-toplevel :execute)
13 (defvar *current-thread* nil))
15 (def!type thread-name () 'simple-string)
17 (defstruct (thread (:constructor %make-thread))
18 "Thread type. Do not rely on threads being structs as it may change
19 in future versions."
20 (name nil :type (or thread-name null))
21 (%alive-p nil :type boolean)
22 (%ephemeral-p nil :type boolean)
23 #-sb-xc-host
24 (os-thread 0 :type sb!vm:word)
25 (interruptions nil :type list)
26 ;; On succesful execution of the thread's lambda a list of values.
27 (result 0)
28 (interruptions-lock
29 (make-mutex :name "thread interruptions lock")
30 :type mutex)
31 (result-lock
32 (make-mutex :name "thread result lock")
33 :type mutex)
34 waiting-for)
36 (def!struct (mutex (:constructor make-mutex (&key name)))
37 "Mutex type."
38 (name nil :type (or null thread-name))
39 (%owner nil :type (or null thread))
40 #!+(and sb-thread sb-futex)
41 (state 0 :type fixnum))