Use atomic integer for compiler driver work balancing.

Before, we divided the work by dividing the total work by the number
of threads. This did not balance work well since some threads could
finish much earlier than others. The new method uses a shared atomic
integer to balance work. This makes it that a thread can process at
most one item after the other worker threads are finished.

Changed the number of threads to take into account the main thread
also doing work. This means that we subtract one from the number of
threads when we make the thread pool.

Change-Id: I0147b0403c6214800ed6bfcdac4f1e5486330996
1 file changed