move kitchen-sink demo into a separate directory
This commit is contained in:
parent
760074ee41
commit
606963f424
39 changed files with 47 additions and 49 deletions
|
|
@ -1,26 +0,0 @@
|
|||
//http://groovy.codehaus.org/Concurrency+with+Groovy
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
def counter = new AtomicInteger()
|
||||
|
||||
synchronized out(message) {
|
||||
println(message)
|
||||
}
|
||||
|
||||
def th = Thread.start {
|
||||
for( i in 1..8 ) {
|
||||
sleep 30
|
||||
out "thread loop $i"
|
||||
counter.incrementAndGet()
|
||||
}
|
||||
}
|
||||
|
||||
for( j in 1..4 ) {
|
||||
sleep 50
|
||||
out "main loop $j"
|
||||
counter.incrementAndGet()
|
||||
}
|
||||
|
||||
th.join()
|
||||
|
||||
assert counter.get() == 12
|
||||
Loading…
Add table
Add a link
Reference in a new issue