test waiting for thread to leave to-be-patched function
