made the slay mechanism more useful (slay by number, not just announced participant)

This commit is contained in:
Stephen McQuay 2011-04-02 01:32:39 -06:00
parent d61a9dadba
commit d5a0d969f8

View File

@ -21,9 +21,15 @@ if sys.argv[1].startswith("st"):
print " slavesq : %d" % sq.qsize()
if sys.argv[1] == 'slay':
if len(sys.argv) == 2:
for i in xrange(mq.qsize()):
print i, "killing", mq.get()
sq.put("slay")
elif len(sys.argv) == 3:
for i in xrange(int(sys.argv[2])):
print i, "killing ... jane?"
sq.put("slay")
if sys.argv[1] == 'clear':
for i in xrange(tq.qsize()): print tq.get()