Nearly finished. Call to set_wakeup missing in case of tasks added to pending_timeout