diff --git a/src/tools/concurrency/TracingBackend.java b/src/tools/concurrency/TracingBackend.java index 9fe60496e..76615cb7f 100644 --- a/src/tools/concurrency/TracingBackend.java +++ b/src/tools/concurrency/TracingBackend.java @@ -19,6 +19,7 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.LockSupport; import javax.management.Notification; import javax.management.NotificationEmitter; @@ -274,6 +275,10 @@ public static final void forceSwapBuffers() { } else if (t.swapTracingBufferIfThreadSuspendedInDebugger()) { runningThreads -= 1; result[i] = null; + } else if (isBlockedInJava(t)) { + runningThreads -= 1; + result[i] = null; + t.getBuffer().swapStorage(); } } } @@ -290,6 +295,11 @@ public static final void forceSwapBuffers() { } } + private static boolean isBlockedInJava(final Thread t) { + Object blocker = LockSupport.getBlocker(t); + return blocker != null; + } + public static final long[] getStatistics() { if (currentWorkerThread == null) { return new long[] {0, 0}; @@ -394,7 +404,9 @@ protected TraceWorkerThread(final byte snapshotVersion) { this.snapshotVersion = snapshotVersion; } - protected TraceWorkerThread() {} + protected TraceWorkerThread() { + super("TraceWorkerThread"); + } private BufferAndLimit tryToObtainBuffer() { BufferAndLimit buffer; diff --git a/tools/kompos/.vscode/tasks.json b/tools/kompos/.vscode/tasks.json index 02d9a9a9b..07bdf6717 100644 --- a/tools/kompos/.vscode/tasks.json +++ b/tools/kompos/.vscode/tasks.json @@ -1,29 +1,48 @@ { - "version": "0.1.0", - "command": "npm", - "isShellCommand": true, - "showOutput": "always", + "version": "2.0.0", "echoCommand": true, - "suppressTaskName": true, "options": { "cwd": "${workspaceRoot}" }, "tasks": [ { - "taskName": "continuous compilation", + "type": "process", + "group": "build", + "label": "continuous compilation", + "command": "npm", "isBackground": true, "args": ["run", "watch"], - "problemMatcher": "$tsc-watch" + "problemMatcher": "$tsc-watch", + "presentation": { + "reveal": "silent", + "panel": "shared" + } }, { - "taskName": "test", + "type": "process", + "label": "test", + "group": "test", + "command": "npm", "isBackground": false, - "args": [] + "args": ["test"], + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "clear": true + } }, { - "taskName": "format", + "type": "process", + "command": "npm", + "label": "format", + "group": "build", "isBackground": false, - "args": ["run", "format"] + "args": ["run", "format"], + "presentation": { + "reveal": "silent", + "panel": "shared" + } } ] }