public class BarrierTracing {
- public static final boolean BOOKKEEPING = false;
+ private static final String KEY = "SIMANTICS_DB_IMPL_BARRIER_TRACING";
+
+ public static final boolean BOOKKEEPING = Boolean.parseBoolean(
+ System.getProperty("org.simantics.db.impl.barrierTracing",
+ System.getenv(KEY) != null ? System.getenv(KEY) : "false")
+ );
static final boolean RESTART_GUARD = BOOKKEEPING && false;
public static Map<SessionTask,Exception> tasks = new HashMap<>();
synchronized public static void printBAPS() {
for(BlockingAsyncProcedure bap : baps.keySet()) {
- Throwable e = baps.get(bap);
- System.err.println("BlockingAsyncProcedure");
- System.err.println("-key: " + bap.key);
- System.err.println("-queryGraph: " + bap.queryGraph);
- System.err.println("-callerGraph: " + bap.callerGraph);
- System.err.println("-procedure: " + bap.procedure);
- System.err.println("-pendingTaskSupport: " + bap.pendingTaskSupport);
- System.err.println("-result: " + bap.result);
- System.err.println("-exception: " + bap.exception);
- e.printStackTrace();
+ bap.print();
+ Throwable t = baps.get(bap);
+ if(t != null)
+ t.printStackTrace();
}
}