From: Rico Tzschichholz Date: Sun, 16 Sep 2018 17:27:17 +0000 (+0200) Subject: test: Add property lock test X-Git-Tag: 0.42.1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b543fc8426e86d0ff4f90a1e6687f665af40206;p=thirdparty%2Fvala.git test: Add property lock test --- 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");