mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
X10
This commit is contained in:
parent
860e3c066b
commit
d5ad212703
6 changed files with 67 additions and 4 deletions
|
@ -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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue