Merge branch 'master' of feistymeow.org:feisty_meow
[feisty_meow.git] / scripts / processes / process_manager.sh
index 31049f5e99844c2fe011af2822914833d53828a6..48737e471867db33d80ed39a482a704f0ac03b59 100644 (file)
@@ -80,10 +80,16 @@ function wait_on_backgrounders()
   echo "done waiting, background process count is down to $bg_count."
 }
 
+#hmmm: the demo app here raises some concerns--how do we know the bg count is right?
+#      what if something died and we didn't check it?
+#      will the thing that looks at bg count adjust it if there are actually no waiting processes?
+
 # happily launches off different actions as background processes.
 launcher_demonstrator()
 {
-  while true; do
+  # run a limited number of loops, since we don't want to do this forever.
+  local loops=50
+  while ((loops-- > 0)); do
     # pick a thing to do.
     which=$(($RANDOM % 3))
 #hmmm: not asynch yet!  make it so!