Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

20
LINES

< > BotCompany Repo | #1009307 // deadlockedThreadsToString

JavaX fragment (include)

static S deadlockedThreadsToString(L<ThreadInfo> threadInfo) {
  new L<S> out;
  int i = 0;
  Map<ThreadInfo, Thread> map = threadInfosToThreads_map(threadInfo);
  for (ThreadInfo threadInfo1 : threadInfo) {
    out.add("Thread " + (++i) + "/" + l(threadInfo) + ": ID=" + threadInfo1.getThreadId()
      + ", name=" + quote(threadInfo1.getThreadName()));
    out.add("  Trying to lock: " + threadInfo1.getLockName()
      + " which is owned by thread " + threadInfo1.getLockOwnerId()
      + " (" + quote(threadInfo1.getLockOwnerName()) + ")");
    // ThreadInfo.getStackTrace() doesn't work, so we look up the thread.
    Thread t = map.get(threadInfo1);
    if (t != null) {
      StackTraceElement[] st = t.getStackTrace();
      out.add("Stack trace (" + l(st) + "): ");
      out.add(indentx(stackTraceToString(st)));
    }
  }
  ret lines(out);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009307
Snippet name: deadlockedThreadsToString
Eternal ID of this version: #1009307/10
Text MD5: ae130209323208189e1782b73f19f6ec
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-23 02:17:41
Source code size: 871 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 514 / 538
Version history: 9 change(s)
Referenced in: [show references]