[armedbear-devel] threads, join, clos
David Kirkman
dkirkman at ucsd.edu
Sat Apr 24 20:58:06 UTC 2010
On Sat, Apr 24, 2010 at 1:57 AM, Erik Huelsmann <ehuels at gmail.com> wrote:
>
> I have one question regarding the patch though: How would the caller
> know the difference between the scenario where an Interrupted
> exception occurs and the one where the thread is really joined?
>
> Should we use the return value NIL to signal "not joined" and T for "joined"?
Yes! Here is an updated patch that does that.
The other option for thread-join return values is to have
it return the value of the function used in make-thread.
That way thread-join will both wait for the thread to finish
and collect it's value, and I don't have to set up global
variables to collect the results. (Which is the way I always
*want* join to work!)
I've included a second patch in which implements join that way. It
also returns a second T/NIL value indicating if the thread finished
normally or was interrupted. The only disadvantage to this is that
in other languages join either returns nothing or a
success/failure code.
Cheers,
-david
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thread-join-t-nil.diff
Type: application/octet-stream
Size: 1060 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20100424/3b221a5c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thread-join-multiple-values.diff
Type: application/octet-stream
Size: 2150 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20100424/3b221a5c/attachment-0001.obj>
More information about the armedbear-devel
mailing list