def random_wipe(devs):
 global PROGRESS
 PROGRESS = 0.0
 threads = []
 sentinels = []
 for dev in devs:
  thread = RandomWorker(dev)
  thread.start()
  threads.append(thread)
  sentinel = RandomSentinel(worker=thread)
  sentinel.start()
  sentinels.append(sentinel)
 tobreak = False
 while (not tobreak):
  progress = 0
  numthreads = len(threads)
  tobreak = True
  for thread in threads:
   tobreak &= (not thread.is_alive())
   progress += thread.progress()
  progress /= numthreads
  PROGRESS = progress
  time.sleep(1)

def random_wipe ( devs ) : global PROGRESS PROGRESS = 0.0 threads = [ ] sentinels = [ ] for dev in devs : thread = RandomWorker ( dev ) thread . start ( ) threads . append ( thread ) sentinel = RandomSentinel ( worker = thread ) sentinel . start ( ) sentinels . append ( sentinel ) tobreak = False while ( not tobreak ) : progress = 0 numthreads = len ( threads ) tobreak = True for thread in threads : tobreak &= ( not thread . is_alive ( ) ) progress += thread . progress ( ) progress /= numthreads PROGRESS = progress time . sleep ( 1 )
concurrently wipe devs using /dev/random .