In SBCL, how can you access the RESULT slot of a completed thread? The slot-value of an instance does not seem to work:
* (defparameter th (bt:make-thread (lambda () (LOOP FOR I FROM 1 TO 1000000 SUM (* I I)))))
TH
* (describe th)
#<SB-THREAD:THREAD "Anonymous thread" FINISHED values: 333333833333500000 {1005C0A183}>
[structure-object]
Slots with :INSTANCE allocation:
NAME = "Anonymous thread"
%ALIVE-P = NIL
%EPHEMERAL-P = NIL
OS-THREAD = 18446744073709551615
PRIMITIVE-THREAD = 62332928
INTERRUPTIONS = NIL
RESULT = (333333833333500000)
INTERRUPTIONS-LOCK = #<SB-THREAD:MUTEX "thread interruptions lock" (free)>
RESULT-LOCK = #<SB-THREAD:MUTEX "thread result lock" (free)>
WAITING-FOR = NIL
* (slot-value th 'result)
debugger invoked on a SIMPLE-ERROR in thread
#<THREAD "main thread" RUNNING {10012E0613}>:
When attempting to read the slot's value (slot-value), the slot RESULT is
missing from the object
Accessing the result of a Bordeaux Thread bt:make-thread cal
-
- Posts: 1
- Joined: Wed Mar 13, 2019 10:41 pm
-
- Posts: 166
- Joined: Sun Nov 28, 2010 4:21 pm
Re: Accessing the result of a Bordeaux Thread bt:make-thread
Try JOIN-THREAD