changeset 9:8300e1fb8952

Added implementation of alarm_at/3 for older versions of SWI that don't have it.
author samer
date Wed, 22 Feb 2012 17:34:06 +0000
parents 71aa901aa435
children 33c1cac37be1
files qutils.pl
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/qutils.pl	Wed Feb 15 15:04:23 2012 +0000
+++ b/qutils.pl	Wed Feb 22 17:34:06 2012 +0000
@@ -18,8 +18,16 @@
 %  NB: may fail if Msg is bound on input.
 get_message_or_timeout(inf,Msg) :- !, thread_get_message(Msg).
 
+% Older versions of SWI do not have alarm_at/3
+:- if(\+current_predicate(alarm_at/3)).
+:- writeln('% compiling alarm_at/3.').
+alarm_at(A,B,C) :- alarm_at(A,B,C,[]).
+:- endif.
+
+% Older versions of SWI do not have thread_get_message/3
 :- if(current_predicate(thread_get_message/3)).
 
+% we have thread_get_message/3 but we may or may not have the deadline/1 option
 :- if(current_predicate_option(thread_get_message/3,3,deadline(_))).
 
 :- writeln('% compiling get_message_or_timeout/2 using deadline/1 option.').