[PATCH v3 6/9] server: Use an event as thread context sync.