* commit 'bd04922f8fe08e132667da41fe55dad2e8044d0b': Move the main thread check to the appropriate place.