IO_METHOD(IoCoroutine, run) { /*doc Coroutine run Runs receiver and returns self. */ IoCoroutine_rawRun(self); return IoCoroutine_rawResult(self); }
IoObject *IoState_tryToPerform(IoState *self, IoObject *target, IoObject *locals, IoMessage *m) { IoCoroutine *tryCoro = IoCoroutine_newWithTry(self, target, locals, m); if (IoCoroutine_rawException(tryCoro) != self->ioNil) { IoState_exception_(self, tryCoro); } return IoCoroutine_rawResult(tryCoro); return IoMessage_locals_performOn_(m, locals, target); }
IoObject *IoDrawStuff_tryCallback(IoDrawStuff *self, IoMessage *m) { IoState *state = IoObject_state(proto); IoObject *tryCoro = DATA(self)->coroutine; IoObject *t = DATA(self)->eventTarget; IoObject *result = state->ioNil; //printf("IoDrawStuff_tryCallback(self, %p)\n", (void*)m); //printf("IoDrawStuff_tryCallback target: %p)\n", (void*)t); if(t) { IoMessage_locals_performOn_(m, t, t); if (IoCoroutine_rawException(tryCoro) != state->ioNil) IoState_exception_(state, tryCoro); IoCoroutine_clearStack(tryCoro); return IoCoroutine_rawResult(tryCoro); } return result; }
IoObject *IoCoroutine_run(IoCoroutine *self, IoObject *locals, IoMessage *m) { IoCoroutine_rawRun(self); return IoCoroutine_rawResult(self); }