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

12
LINES

< > BotCompany Repo | #1007575 // autoCleanUpTimer - clean up a java.util.Timer on program clean-up - not really needed

JavaX fragment (include)

1  
static Map<java.util.Timer, Bool> autoCleanUpTimer_timers = synchroMap(new WeakHashMap);
2  
3  
static java.util.Timer autoCleanUpTimer(java.util.Timer timer) {
4  
  autoCleanUpTimer_timers.put(timer, true);
5  
  ret timer;
6  
}
7  
8  
static void cleanMeUp_autoCleanUpTimer() {
9  
  for (java.util.Timer timer : keys(autoCleanUpTimer_timers))
10  
    timer.cancel();
11  
  autoCleanUpTimer_timers.clear();
12  
}

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: #1007575
Snippet name: autoCleanUpTimer - clean up a java.util.Timer on program clean-up - not really needed
Eternal ID of this version: #1007575/2
Text MD5: 1add2bb734c17fa364d16ae9b926ecf5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-27 13:52:40
Source code size: 387 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 445 / 454
Version history: 1 change(s)
Referenced in: [show references]