# HG changeset patch # User samer # Date 1355944590 0 # Node ID c91d53b19dbb09771dda9ad6bab76c743b508ca4 # Parent 44417282afeca807f34a90cab87ca7f8182cf2c8# Parent 02d99048fb78b086ce48705658c0061182a733a9 Meh? diff -r 02d99048fb78 -r c91d53b19dbb qutils.pl --- a/qutils.pl Thu Aug 23 09:48:58 2012 +0100 +++ b/qutils.pl Wed Dec 19 19:16:30 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) :- thread_self(Thread), ( thread_get_message(Thread,Msg,[deadline(Deadline)]) @@ -47,6 +49,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),