[vala/0.10: 13/38] Add mutex field in priv structures for properties



commit 9df2ce99f23abfee1ff2341b9e8d92d61cddfbf6
Author: Luca Bruno <lethalman88 gmail com>
Date:   Sat Jul 24 21:20:33 2010 +0200

    Add mutex field in priv structures for properties
    
    Fixes bug 625200.

 codegen/valagtypemodule.vala |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 054fdef..b2310e7 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -458,6 +458,22 @@ public class Vala.GTypeModule : GErrorModule {
 			}
 		}
 
+		foreach (Property prop in cl.get_properties ()) {
+			if (prop.binding == MemberBinding.INSTANCE) {
+				if (prop.get_lock_used ()) {
+					has_instance_locks = true;
+					// add field for mutex
+					instance_priv_struct.add_field (mutex_type.get_cname (), get_symbol_lock_name (prop.name));
+				}
+			} else if (prop.binding == MemberBinding.CLASS) {
+				if (prop.get_lock_used ()) {
+					has_class_locks = true;
+					// add field for mutex
+					type_priv_struct.add_field (mutex_type.get_cname (), get_symbol_lock_name (prop.name));
+				}
+			}
+		}
+
 		if (is_gtypeinstance) {
 			if (cl.has_class_private_fields || has_class_locks) {
 				decl_space.add_type_declaration (new CCodeTypeDefinition ("struct %s".printf (type_priv_struct.name), new CCodeVariableDeclarator ("%sClassPrivate".printf (cl.get_cname ()))));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]