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

22
LINES

< > BotCompany Repo | #1004549 // cancelThread - cancel thread through ping()

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4532L/25K).

svoid cancelThread(Thread t) {
  if (t == null) ret;
  ping();
  ifndef LeanMode
  
  ifdef PingV3
    var ps = pingSource(t);
    if (ps == null)
      warn("No ping source for thread " + t + ", can't cancel");
    else
      ps.cancel();
  endifdef
  
  ifndef PingV3
    synchronized(ping_actions) {
      ping_actions.put(t, "cancelled");
      ping_anyActions = true;
    }
  endifndef
  
  endifndef
}

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1004549
Snippet name: cancelThread - cancel thread through ping()
Eternal ID of this version: #1004549/12
Text MD5: 645ceb73b43ba3a5324aa8fde3cada2c
Transpilation MD5: 7528071d0c17700e7da25e1edddacd0e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-11-02 00:05:25
Source code size: 428 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 656 / 763
Version history: 11 change(s)
Referenced in: [show references]