[armedbear-devel] threads, join, clos
ehuels at gmail.com
Sat Apr 24 22:33:37 UTC 2010
On Sat, Apr 24, 2010 at 10:58 PM, David Kirkman <dkirkman at ucsd.edu> wrote:
> 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.
Thanks for your contribution! I committed the second variant in r12634.
I'll look at the threading issues you've raised in the other thread
tomorrow. Bedtime now.
More information about the armedbear-devel