I'd add some asserts in the main thread to call out what the worker thread state is supposed to be in a few places (to improve readability). Other than that, LGTM. REPOSITORY rL LLVM http://reviews.llvm.org/D6750 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/