introduce _sync_thread_ macro