You could also just use a simple java.util.concurrent.CountDownLatch with the proper size. 

On Jun 9, 2013, at 3:33 PM, Matei Zaharia <notifications@github.com> wrote:

> In core/src/test/scala/spark/scheduler/LocalSchedulerSuite.scala:
> 
> > +
> > +    createThread(1,null,sc,sem)
> > +    createThread(2,null,sc,sem)
> > +    createThread(3,null,sc,sem)
> > +    createThread(4,null,sc,sem)
> > +    createThread(5,null,sc,sem)
> > +    createThread(6,null,sc,sem)
> > +    assert(TaskThreadInfo.threadToRunning(1) === true)
> > +    assert(TaskThreadInfo.threadToRunning(2) === true)
> > +    assert(TaskThreadInfo.threadToRunning(3) === true)
> > +    assert(TaskThreadInfo.threadToRunning(4) === true)
> > +    assert(TaskThreadInfo.threadToRunning(5) === false)
> > +    assert(TaskThreadInfo.threadToRunning(6) === false)
> > +    
> > +    TaskThreadInfo.threadToLock(1).jobFinished()
> > +    Thread.sleep(1000)
> This sleep would also be nice to replace with some kind of semaphore or shared state; at the very least have a static volatile threadsFinished variable (in some kind of static object) and do while (threadsFinished < 4) { Thread.sleep(100) }
> 
> —
> Reply to this email directly or view it on GitHub.