[vala] test: Add property lock test
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] test: Add property lock test
- Date: Mon, 17 Sep 2018 06:56:49 +0000 (UTC)
commit 4b543fc8426e86d0ff4f90a1e6687f665af40206
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Sep 16 19:27:17 2018 +0200
test: Add property lock test
tests/objects/properties.vala | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/tests/objects/properties.vala b/tests/objects/properties.vala
index 3d86de106..8008c1acb 100644
--- a/tests/objects/properties.vala
+++ b/tests/objects/properties.vala
@@ -28,6 +28,9 @@ public class Sample : Object {
get { return _read_only; }
}
+ public int public_prop { get; set; }
+ private int private_prop { get; set; }
+
public Sample (string name) {
this.name = name;
}
@@ -56,7 +59,14 @@ public class Sample : Object {
stdout.printf("automatic: %s\n", automatic);
this.deleg = null;
- }
+
+ lock (public_prop) {
+ public_prop = 42;
+ }
+ lock (private_prop) {
+ private_prop = 42;
+ }
+ }
public static int main () {
var test = new Sample("InitialName");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]