The approach looks right. I'll let somebody who works on the NativeThread side weigh in on whether the implementation is correct. http://reviews.llvm.org/D8081 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/