From 570513f8f9c1b288e3ed45b1daaccf0c2ba72e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Wed, 26 Nov 2014 09:46:44 +0000 Subject: [PATCH] fix mutex creation --- pl/threads.yap | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pl/threads.yap b/pl/threads.yap index 79e2ef268..a9dca3495 100644 --- a/pl/threads.yap +++ b/pl/threads.yap @@ -878,12 +878,6 @@ There is no limit to the number of mutexes that can be created. */ -mutex_create(Mutex) :- - ( atom(Mutex) -> - mutex_create(_, [alias(Mutex)]) - ; mutex_create(Mutex, []) - ). - mutex_create(Id, Options) :- nonvar(Id), !, '$do_error'(uninstantiation_error(Id), mutex_create(Id, Options)). @@ -891,13 +885,8 @@ mutex_create(Id, Options) :- Goal = mutex_create(Id, Options), '$mutex_options'(Options, Alias, Goal), ( atom(Alias) -> - ( recorded('$mutex_alias',[_| Alias], _) -> - '$do_error'(permission_error(create, mutex, Alias), Goal) - ; '$new_mutex'(Id), - recorda('$mutex_alias', [Id| Alias], _) - ) - ; '$new_mutex'(Id), - recorda('$mutex_alias', [Id| Id], _) + mutex_create(Alias) + ; mutex_create(Id) ). '$mutex_options'(Var, _, Goal) :-