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

10
LINES

< > BotCompany Repo | #1016642 // allThreads_fast

JavaX fragment (include)

static L<Thread> allThreads_fast() {
  ThreadGroup rootGroup = rootThreadGroup();
  Thread[] threads = new Thread[rootGroup.activeCount()+10];
  int n;
  while ((n = rootGroup.enumerate(threads, true)) == threads.length)
    threads = new Thread[threads.length*2];
  L<Thread> l = new ArrayList<Thread>(n);
  for (int i = 0; i < n; i++) l.add(threads[i]);
  ret l;
}

Author comment

Began life as a copy of #1016296

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: #1016642
Snippet name: allThreads_fast
Eternal ID of this version: #1016642/2
Text MD5: 7987226ca8834aedd44ea2f3d9d9eb32
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-26 15:07:15
Source code size: 375 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 355 / 382
Version history: 1 change(s)
Referenced in: [show references]