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

17
LINES

< > BotCompany Repo | #1016694 // renderSleepingThreadsWithStackTraces

JavaX fragment (include)

static S renderSleepingThreadsWithStackTraces() {
  Map<Thread, StackTraceElement[]> threadMap = Thread.getAllStackTraces();
  S threadDescription = "sleeping thread";
  new StringBuilder buf;
  int n = 0;
  for (Thread t : threadMap.keySet()) {
    continue if isThreadRunnable_x(t, threadMap.get(t));
    ++n;
    printTo(buf, t);
    for (StackTraceElement e : threadMap.get(t)) {
      printTo(buf, "  " + e);
    }
    printTo(buf);
  }
  printTo(buf, n(n, threadDescription) + ".");
  ret asciiHeading2(n(n, threadDescription) + " (+" + (l(threadMap)-n)  + ")") + "\n" + buf;
}

Author comment

Began life as a copy of #1010502

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: #1016694
Snippet name: renderSleepingThreadsWithStackTraces
Eternal ID of this version: #1016694/3
Text MD5: 75098a7a0524c59e96ea79370639bc52
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-28 12:49:04
Source code size: 599 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 354 / 377
Version history: 2 change(s)
Referenced in: [show references]