diff src/settings.sml @ 1308:714e8b84221b

-limit for running time
author Adam Chlipala <adam@chlipala.net>
date Thu, 14 Oct 2010 11:35:56 -0400
parents d2ad997ca157
children 0d8bd8ae8417
line wrap: on
line diff
--- a/src/settings.sml	Thu Oct 14 11:06:26 2010 -0400
+++ b/src/settings.sml	Thu Oct 14 11:35:56 2010 -0400
@@ -492,12 +492,16 @@
 
 val limits = ["messages", "clients", "headers", "page", "heap", "script",
               "inputs", "subinputs", "cleanup", "deltas", "transactionals",
-              "globals", "database"]
+              "globals", "database", "time"]
 
 val limitsList = ref ([] : (string * int) list)
 fun addLimit (v as (name, _)) =
     if List.exists (fn name' => name' = name) limits then
-        limitsList := v :: !limitsList
+        (limitsList := v :: !limitsList;
+         if name = "time" then
+             setDeadlines true
+         else
+             ())
     else
         raise Fail ("Unknown limit category '" ^ name ^ "'")
 fun limits () = !limitsList