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)

svoid runShutdownHooksWithDefunctACC() {
  for (Thread t : listShutdownHooks()) pcall {
    AccessControlContext acc = castGetOpt(t, 'inheritedAccessControlContext);
    L<S> defunctIDs;
    if (nempty(defunctIDs = acc_defunctProgramIDs(acc))) {
      S desc = threadGroupName(t) + " / " + t.getName();
      print("DEFUNCT ACC IN SHUTDOWN HOOK! Running. " + defunctIDs + ": " + desc);
      Runtime.getRuntime().removeShutdownHook(t);
      startThread(t);
    }
  }
}

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: 361 / 378
Referenced in: [show references]