// Get a thread, and start the task.
// If there is no thread available, this will
// block until one becomes available
try
{
ThreadPoolThread tpt = pool.borrowThread();
tpt.setRunnable(r);
tpt.start();
threads.addElement(tpt);
}
catch (Exception ex)
{
throw new BuildException(ex);