# HG changeset patch # User wenzelm # Date 1221159847 -7200 # Node ID 2d93b158ad99e54b831635c35b4fd7f0ce047e58 # Parent 88f18387f1c93df1718e670b6825b6939216e1c1 added is_empty; diff -r 88f18387f1c9 -r 2d93b158ad99 src/Pure/Concurrent/task_queue.ML --- a/src/Pure/Concurrent/task_queue.ML Thu Sep 11 21:04:05 2008 +0200 +++ b/src/Pure/Concurrent/task_queue.ML Thu Sep 11 21:04:07 2008 +0200 @@ -14,6 +14,7 @@ val str_of_group: group -> string type queue val empty: queue + val is_empty: queue -> bool val enqueue: group -> task list -> (bool -> bool) -> queue -> task * queue val depend: task list -> task -> queue -> queue val focus: task list -> queue -> queue @@ -67,7 +68,9 @@ focus: task list}; (*particular collection of high-priority tasks*) fun make_queue groups jobs focus = Queue {groups = groups, jobs = jobs, focus = focus}; + val empty = make_queue Inttab.empty IntGraph.empty []; +fun is_empty (Queue {jobs, ...}) = IntGraph.is_empty jobs; (* enqueue *) diff -r 88f18387f1c9 -r 2d93b158ad99 src/Pure/General/graph.ML --- a/src/Pure/General/graph.ML Thu Sep 11 21:04:05 2008 +0200 +++ b/src/Pure/General/graph.ML Thu Sep 11 21:04:07 2008 +0200 @@ -13,6 +13,7 @@ exception SAME exception UNDEF of key val empty: 'a T + val is_empty: 'a T -> bool val keys: 'a T -> key list val dest: 'a T -> (key * key list) list val get_first: (key * ('a * (key list * key list)) -> 'b option) -> 'a T -> 'b option @@ -83,6 +84,7 @@ exception SAME = Table.SAME; val empty = Graph Table.empty; +fun is_empty (Graph tab) = Table.is_empty tab; fun keys (Graph tab) = Table.keys tab; fun dest (Graph tab) = map (fn (x, (_, (_, succs))) => (x, succs)) (Table.dest tab);