[sgen] Fix a bug when waking up workers.