Finalizing the beta version of the implementation for Groovy extension in JPF: JPF...
[jpf-core.git] / examples / Racer.groovy
1 class Racer implements Runnable {
2      int d = 42
3
4      public void run () {
5           doSomething(1001)
6           d = 0                              // (1)
7      }
8
9      static void main (String[] args){
10           Racer racer = new Racer()
11           Thread t = new Thread(racer)
12           t.start()
13
14           doSomething(1000)
15           int c = 420 / racer.d              // (2)
16           println c
17      }
18      
19      def doSomething (int n) {
20           try { 
21                 Thread.sleep(n) 
22           } catch (InterruptedException ix) {}
23      }
24 }