slave-pool
Simple thread pool
usage
use ThreadPool;
const SECOND: Duration = from_secs;
static POOL: ThreadPool = new;
POOL.set_threads; //Tell how many threads you want
let mut handles = Vec new;
for _ in 0..8
POOL.set_threads; //Tells to shut down threads
for handle in handles
let handle = POOL.spawn_handle;
assert!; // All are shutdown now
POOL.set_threads; //But let's add one more
assert!;
let handle = POOL.spawn_handle; // We can panic, if we want
assert!; // In that case we'll get error, but thread will be ok
let handle = POOL.spawn_handle;
POOL.set_threads;
assert!;