From: Jürg Billeter Date: Sun, 13 Sep 2009 08:56:27 +0000 (+0200) Subject: GAsync: Do not schedule idle handler for yield statements X-Git-Tag: 0.7.6~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abc5c6d28f735cf03468d7ba51bc119356e19a65;p=thirdparty%2Fvala.git GAsync: Do not schedule idle handler for yield statements --- diff --git a/codegen/valagasyncmodule.vala b/codegen/valagasyncmodule.vala index 22a81acd3..5672006dc 100644 --- a/codegen/valagasyncmodule.vala +++ b/codegen/valagasyncmodule.vala @@ -361,20 +361,11 @@ internal class Vala.GAsyncModule : GSignalModule { } if (stmt.yield_expression == null) { - // should be replaced by a simple return FALSE; when we have - // void idle () yields; - // working in the .vapi - var cfrag = new CCodeFragment (); stmt.ccodenode = cfrag; - var idle_call = new CCodeFunctionCall (new CCodeIdentifier ("g_idle_add")); - idle_call.add_argument (new CCodeCastExpression (new CCodeIdentifier (current_method.get_real_cname () + "_co"), "GSourceFunc")); - idle_call.add_argument (new CCodeIdentifier ("data")); - int state = next_coroutine_state++; - cfrag.append (new CCodeExpressionStatement (idle_call)); cfrag.append (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (new CCodeIdentifier ("data"), "state"), new CCodeConstant (state.to_string ())))); cfrag.append (new CCodeReturnStatement (new CCodeConstant ("FALSE"))); cfrag.append (new CCodeCaseStatement (new CCodeConstant (state.to_string ())));