static volatile L<ThreadInfo> printDeadlocks_lastDeadlock; static L<ThreadInfo> printDeadlocks() { ThreadMXBean bean = ManagementFactory.getThreadMXBean(); long ids[] = bean.findDeadlockedThreads(); if (empty(ids)) ret emptyList(); printAsciiHeading(upper(n2(ids, "deadlocked thread"))); ThreadInfo threadInfo[] = bean.getThreadInfo(ids); print("Got " + n2(threadInfo, "thread info")); S info = print(deadlockedThreadsToString(asList(threadInfo))); appendToFile(javaxDataDir("deadlocks.txt"), "\n\n" + localDateWithSeconds() + "\n\n" + info); ret printDeadlocks_lastDeadlock = asList(threadInfo); }
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1009292 |
Snippet name: | printDeadlocks - print list of deadlocked threads; returns the list of deadlocked ThreadInfo objects |
Eternal ID of this version: | #1009292/12 |
Text MD5: | 8639fc7c92e4133d127dfcc3807fbcd1 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-22 08:55:03 |
Source code size: | 633 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 625 / 670 |
Version history: | 11 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1009295 - printDeadlocks_monitorsOnly - print list of deadlocked threads (counting only object monitor deadlocks); returns the list of deadlocked ThreadInfo objects #1009354 - printDeadlocksAndSolve - print & solve deadlocks |