2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00
This commit is contained in:
Martin Thoma 2014-03-28 11:51:59 +01:00
parent 860e3c066b
commit d5ad212703
6 changed files with 67 additions and 4 deletions

View file

@ -0,0 +1,18 @@
// push data on concurrent
// list-stack
val node = new Node(data);
atomic {
node.next = head;
head = node;
}
// target defined in
// enclosing scope
atomic def CAS(old:Object, n:Object) {
if (target.equals(old)) {
target = n;
return true;
}
return false;
}