main: end sync for each task