This routine was modified, modified, and remodified in a series of hacks.  It is a kludge waiting to fall apart.  The goal is to rewrite the entire threading logic in Riak 2.0 based upon the now known characteristics of compaction work loads.  New work will use "hot threads" thread pool of eleveldb to create 4 pools (with far better management code than what you see).  Pools will be universal, not fixed count per env object.