From: Luca Bruno Date: Mon, 19 Nov 2012 13:06:30 +0000 (+0100) Subject: Support scope = "async" on parameters. X-Git-Tag: 0.19.0~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bd22fbfc6ac8447ef92e877ac8c28eb9e55588b;p=thirdparty%2Fvala.git Support scope = "async" on parameters. This flag is still useful on delegates such as ThreadFunc that are always scope = "async" by default. The flag on the parameter will override the flag has been set on the delegate. --- diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala index b089dde22..c42d6f33a 100644 --- a/vala/valaparameter.vala +++ b/vala/valaparameter.vala @@ -147,6 +147,11 @@ public class Vala.Parameter : Variable { return false; } + if (has_attribute_argument ("CCode", "scope") && variable_type is DelegateType) { + var delegate_type = (DelegateType) variable_type; + delegate_type.is_called_once = get_attribute_string ("CCode", "scope") == "async"; + } + if (initializer != null) { initializer.target_type = variable_type.copy (); initializer.check (context);