Revert "Revert "Thread improvements in thread_exposure""

This reverts commit 9f51293804d45fe66958d7cf73eba6bab0537f51.