fix sync thread deadlock bug