Implemented task_create and event_wait