[vala] dova: Add support for [ThreadLocal] fields
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] dova: Add support for [ThreadLocal] fields
- Date: Fri, 16 Jul 2010 22:07:09 +0000 (UTC)
commit cf8204cb9c6054d42edd8129cc082167d6ca0a01
Author: Jürg Billeter <j bitron ch>
Date: Fri Jul 16 23:34:11 2010 +0200
dova: Add support for [ThreadLocal] fields
ccode/valaccodedeclaration.vala | 5 ++++-
ccode/valaccodemodifiers.vala | 6 ++++--
codegen/valadovabasemodule.vala | 10 ++++++++++
3 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/ccode/valaccodedeclaration.vala b/ccode/valaccodedeclaration.vala
index 556174e..95216f8 100644
--- a/ccode/valaccodedeclaration.vala
+++ b/ccode/valaccodedeclaration.vala
@@ -1,6 +1,6 @@
/* valaccodedeclaration.vala
*
- * Copyright (C) 2006-2008 Jürg Billeter
+ * Copyright (C) 2006-2010 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -82,6 +82,9 @@ public class Vala.CCodeDeclaration : CCodeStatement {
if ((modifiers & CCodeModifiers.EXTERN) != 0 && !has_initializer ()) {
writer.write_string ("extern ");
}
+ if ((modifiers & CCodeModifiers.THREAD_LOCAL) != 0) {
+ writer.write_string ("thread_local ");
+ }
writer.write_string (type_name);
writer.write_string (" ");
diff --git a/ccode/valaccodemodifiers.vala b/ccode/valaccodemodifiers.vala
index d2a96f2..4dd7455 100644
--- a/ccode/valaccodemodifiers.vala
+++ b/ccode/valaccodemodifiers.vala
@@ -1,6 +1,7 @@
/* valaccodemodifiers.vala
*
- * Copyright (C) 2006-2008 Jürg Billeter, Raffaele Sandrini
+ * Copyright (C) 2006-2010 Jürg Billeter
+ * Copyright (C) 2006-2008 Raffaele Sandrini
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -31,5 +32,6 @@ public enum Vala.CCodeModifiers {
EXTERN = 1 << 2,
INLINE = 1 << 3,
VOLATILE = 1 << 4,
- DEPRECATED = 1 << 5
+ DEPRECATED = 1 << 5,
+ THREAD_LOCAL = 1 << 6
}
diff --git a/codegen/valadovabasemodule.vala b/codegen/valadovabasemodule.vala
index f67ca33..b180c7f 100644
--- a/codegen/valadovabasemodule.vala
+++ b/codegen/valadovabasemodule.vala
@@ -451,6 +451,11 @@ internal class Vala.DovaBaseModule : CCodeModule {
} else {
cdecl.modifiers = CCodeModifiers.EXTERN;
}
+
+ if (f.get_attribute ("ThreadLocal") != null) {
+ cdecl.modifiers |= CCodeModifiers.THREAD_LOCAL;
+ }
+
decl_space.add_type_member_declaration (cdecl);
}
@@ -527,6 +532,11 @@ internal class Vala.DovaBaseModule : CCodeModule {
} else {
var_def.modifiers = CCodeModifiers.STATIC;
}
+
+ if (f.get_attribute ("ThreadLocal") != null) {
+ var_def.modifiers |= CCodeModifiers.THREAD_LOCAL;
+ }
+
source_declarations.add_type_member_declaration (var_def);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]