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

7
LINES

< > BotCompany Repo | #1019879 // runInterruptibly - run in a new thread & provide an interruption function

JavaX fragment (include)

svoid runInterruptibly(final VF1<Runnable> r, O... _) {
  final new Var<Thread> thread;
  startThread((S) optPar(_, 'threadName), r {
    final Thread t = currentThread();
    callF(r, r { cancelAndInterruptThread(t) });
  });
}

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019879
Snippet name: runInterruptibly - run in a new thread & provide an interruption function
Eternal ID of this version: #1019879/6
Text MD5: 5d050e386a2943f6cd905c716b0cda3d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-30 18:21:40
Source code size: 234 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 329 / 371
Version history: 5 change(s)
Referenced in: [show references]