From 045965e3ed0a4cddfd3f4224c12d56cf65e056ed Mon Sep 17 00:00:00 2001 From: pmoura Date: Sun, 24 Feb 2008 12:28:05 +0000 Subject: [PATCH] Completed ISO DTR definition of the message_queue_create/2 predicate. Still commented out waiting for a bug fix when creating queues without using aliases. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2113 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- pl/threads.yap | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pl/threads.yap b/pl/threads.yap index 2279ca33b..27a4e9dc9 100644 --- a/pl/threads.yap +++ b/pl/threads.yap @@ -523,7 +523,7 @@ message_queue_create(Id, [alias(Alias)]) :- message_queue_create(Id, [alias(Alias)]) :- \+ atom(Alias), !, '$do_error'(type_error(atom,Alias), message_queue_create(Id, [alias(Alias)])). -message_queue_create(Id, [alias(Alias)]) :- +message_queue_create(Id, [alias(Alias)]) :- !, '$global_queue_mutex'(QMutex), '$lock_mutex'(QMutex), '$new_mutex'(Mutex), @@ -538,13 +538,17 @@ message_queue_create(Id, [alias(Alias)]) :- ; recorda('$queue',q(Alias,Mutex,Cond,Id), _), '$unlock_mutex'(QMutex) ). +message_queue_create(Id, [Option| _]) :- + '$do_error'(domain_error(queue_option, Option), message_queue_create(Id, [Option| _])). +message_queue_create(Id, Options) :- + '$do_error'(type_error(list, Options), message_queue_create(Id, Options)). message_queue_create(Id) :- ( var(Id) -> % ISO DTR message_queue_create(Id, []) ; atom(Id) -> % old behavior message_queue_create(_, [alias(Id)]) - ; + ; '$do_error'(type_error(variable, Id), message_queue_create(Id)). ). */ message_queue_create(_, [alias(Alias)]) :- % TEMPORARY FIX