[vala] Support scope = "async" on parameters.
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Support scope = "async" on parameters.
- Date: Mon, 19 Nov 2012 13:10:59 +0000 (UTC)
commit 0bd22fbfc6ac8447ef92e877ac8c28eb9e55588b
Author: Luca Bruno <lucabru src gnome org>
Date: Mon Nov 19 14:06:30 2012 +0100
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.
vala/valaparameter.vala | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala
index b089dde..c42d6f3 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]