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

11
LINES

< > BotCompany Repo | #1012703 // Keep reference to ended threads Spike (OK, seems to cause no harm)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (1504L/10K).

1  
!7
2  
3  
static new AtomicLong ended;
4  
5  
p {
6  
  new L<Thread> threads;
7  
  repeat with ms sleep 1 {
8  
    threads.add(startThread(r { incAtomicLong(ended) }));
9  
    print("Number of Thread objects: " + l(threads) + ". Not ended: " + (l(threads)-ended.longValue()) + ". Number of threads: " + numberOfAllThreads());
10  
  }
11  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012703
Snippet name: Keep reference to ended threads Spike (OK, seems to cause no harm)
Eternal ID of this version: #1012703/7
Text MD5: e0653fe8e8d8a2aa3764cba98a59fea7
Transpilation MD5: 01896ee687780953de36d2373c1d86ba
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-10 18:09:31
Source code size: 317 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 500 / 1203
Version history: 6 change(s)
Referenced in: [show references]