svoid test_ThreadPool() { new ThreadPool pool; print(pool); flagTest(flag -> pool.acquireThread((Runnable) flag); print(pool); int n = pool.maxSize()*2; repeat n { new AtomicInt counter; var t = pool.acquireThread(r { sleepSeconds(1.0); printWithMS(this + " done"); inc(counter); }); printWithMS("Acquired thread " + t); } waitUntilAtomicIntEq(counter, n); print(pool); }