[tor-commits] [tor/master] Limit the number of inflight items to the number of items.

nickm at torproject.org nickm at torproject.org
Tue Jul 21 18:09:07 UTC 2015


commit c68b3418821ddbe6cfaf94fb8959be52e55f2fe1
Author: cypherpunks <cypherpunks at torproject.org>
Date:   Tue Jul 21 12:43:03 2015 +0200

    Limit the number of inflight items to the number of items.
---
 src/test/test_workqueue.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/test/test_workqueue.c b/src/test/test_workqueue.c
index edefb29..24d7ffe 100644
--- a/src/test/test_workqueue.c
+++ b/src/test/test_workqueue.c
@@ -353,6 +353,7 @@ main(int argc, char **argv)
       return 1;
     }
   }
+
   if (opt_n_threads < 1 ||
       opt_n_items < 1 || opt_n_inflight < 1 || opt_n_lowwater < 0 ||
       opt_n_cancel > opt_n_inflight || opt_n_inflight > MAX_INFLIGHT ||
@@ -361,6 +362,10 @@ main(int argc, char **argv)
     return 1;
   }
 
+  if (opt_n_inflight > opt_n_items) {
+      opt_n_inflight = opt_n_items;
+  }
+
   init_logging(1);
   crypto_global_init(1, NULL, NULL);
   crypto_seed_rng();





More information about the tor-commits mailing list