diff --git a/pl/threads.yap b/pl/threads.yap index 073a8aa9c..48f51916b 100644 --- a/pl/threads.yap +++ b/pl/threads.yap @@ -61,8 +61,8 @@ ). % format(user_error,'closing thread ~w~n',[v([Id0|Status])]). '$close_thread'(Exception, Detached, Id0) :- - ( recorded('$thread_exit_status',[Id0|_],R), erase(R), fail - ; recorda('$thread_exit_status', [Id0|exception(error(Exception,_))]) + ( recorded('$thread_exit_status', [Id0|_], R), erase(R), fail + ; recorda('$thread_exit_status', [Id0|exception(error(Exception,_))], _) ), '$run_at_thread_exit'(Id0), ( Detached == true ->