changeset 14:44417282afec

Cleaning up.
author samer
date Wed, 19 Dec 2012 19:11:19 +0000
parents 87c09da8b8ec
children c91d53b19dbb
files qutils.pl
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/qutils.pl	Fri Feb 24 18:32:22 2012 +0000
+++ b/qutils.pl	Wed Dec 19 19:11:19 2012 +0000
@@ -32,6 +32,8 @@
 
 %:- writeln('% compiling get_message_or_timeout/2 using deadline/1 option.').
 
+:- if((current_prolog_flag(version,Version),Version<60102)).
+
 get_message_or_timeout(Deadline,Msg) :- 
 	(	get_time(Now), Now<Deadline
 	->	thread_self(Thread),
@@ -42,6 +44,17 @@
 
 :- else.
 
+get_message_or_timeout(Deadline,Msg) :- 
+	thread_self(Thread),
+	(	thread_get_message(Thread,Msg,[deadline(Deadline)])
+	->	debug(qutils,'got message: ~w.',[Msg])
+	;	Msg=timeout
+	).
+
+:- endif.
+
+:- else.
+
 %:- writeln('% compiling get_message_or_timeout/2 using timeout/1 option.').
 get_message_or_timeout(Deadline,Msg) :- 
 	get_time(Now),