dev/vala/hello/lock.vala

21 lines
412 B
Vala
Raw Normal View History

2012-09-30 19:46:05 +04:00
/* Vala Lock Example */
using GLib;
public class Sample : GLib.Object {
private int critical_data;
public void inc () {
lock (critical_data) {
critical_data++;
}
}
static void main (string[] args) {
var sample = new Sample ();
sample.inc ();
}
}