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

12
LINES

< > BotCompany Repo | #1016341 // runShutdownHooksWithDefunctACC - possibly not perfect logic

JavaX fragment (include)

1  
svoid runShutdownHooksWithDefunctACC() {
2  
  for (Thread t : listShutdownHooks()) pcall {
3  
    AccessControlContext acc = castGetOpt(t, 'inheritedAccessControlContext);
4  
    L<S> defunctIDs;
5  
    if (nempty(defunctIDs = acc_defunctProgramIDs(acc))) {
6  
      S desc = threadGroupName(t) + " / " + t.getName();
7  
      print("DEFUNCT ACC IN SHUTDOWN HOOK! Running. " + defunctIDs + ": " + desc);
8  
      Runtime.getRuntime().removeShutdownHook(t);
9  
      startThread(t);
10  
    }
11  
  }
12  
}

Author comment

Began life as a copy of #1016334

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: #1016341
Snippet name: runShutdownHooksWithDefunctACC - possibly not perfect logic
Eternal ID of this version: #1016341/1
Text MD5: e92f6bf3d80cc3b98e5bd9825cf71933
Author: stefan
Category: javax / maintenance
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-15 22:33:02
Source code size: 480 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 281 / 304
Referenced in: [show references]