Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Properly respect priority among multiple tubes.

  • Loading branch information...
commit 34279364e6155131ba72b977c6f75c8b27b1fff4 1 parent f1d7aca
@kr authored
View
2  prot.c
@@ -373,7 +373,7 @@ next_eligible_job()
t->name, t->waiting.used, t->ready.used);
if (t->waiting.used && t->ready.used) {
candidate = pq_peek(&t->ready);
- if (!j || candidate->id < j->id) j = candidate;
+ if (!j || job_pri_cmp(candidate, j) < 0) j = candidate;
}
dprintf("i = %zu, tubes.used = %zu\n", i, tubes.used);
}
View
9 sh-tests/multi-tube.commands
@@ -0,0 +1,9 @@
+use abc
+put 999999 0 0 0
+
+use def
+put 99 0 0 0
+
+watch abc
+watch def
+reserve
View
8 sh-tests/multi-tube.expected
@@ -0,0 +1,8 @@
+USING abc
+INSERTED 1
+USING def
+INSERTED 2
+WATCHING 2
+WATCHING 3
+RESERVED 2 0
+
Please sign in to comment.
Something went wrong with that request. Please try again.