clear the main thread