]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.testing/src/org/simantics/db/testing/common/Terminator.java
Minor fix and optimization for exporting TG and Pgraph with sharedlib
[simantics/platform.git] / bundles / org.simantics.db.testing / src / org / simantics / db / testing / common / Terminator.java
1 package org.simantics.db.testing.common;
2
3 import java.util.concurrent.TimeUnit;
4
5 import org.simantics.Simantics;
6
7 public class Terminator implements Runnable {
8
9         private boolean disarmed = false;
10         
11         public Terminator(int seconds) {
12                 Simantics.async(this, seconds, TimeUnit.SECONDS);
13         }
14         
15         public void run() {
16                 if(disarmed) return;
17                 System.exit(-1);
18         }
19         
20         public void disarm() {
21                 disarmed = true;
22         }
23         
24         
25 }