| 26 | // Setup working runnable |
| 27 | Runnable workingJob = new Runnable() { |
| 28 | public void run() { |
| 29 | try { |
| 30 | vtkUnstructuredGrid grid = new vtkUnstructuredGrid(); |
| 31 | grid.SetPoints(new vtkPoints()); |
| 32 | vtkPoints p; |
| 33 | long timeout = System.currentTimeMillis() + 60000; // +1 minute |
| 34 | while (System.currentTimeMillis() < timeout) { |
| 35 | p = grid.GetPoints(); |
| 36 | if (p == null) { |
| 37 | throw new RuntimeException("Invalid pointer null"); |
| 38 | } |
| 39 | if (p.GetReferenceCount() != 2) { |
| 40 | throw new RuntimeException("Invalid reference count of " + p.GetReferenceCount()); |
| 41 | } |
| 42 | } |
| 43 | } catch (Throwable e) { |
| 44 | e.printStackTrace(); |
| 45 | vtkJavaTesting.Exit(vtkJavaTesting.FAILED); |
| 46 | } |
| 47 | } |
| 48 | }; |
| 49 | |
| 50 | // Start threads for concurrency (2xwork + 1xGC + 1xGCinEDT) |