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

26
LINES

< > BotCompany Repo | #1031415 // tempNewPing_addToStack

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

Libraryless. Click here for Pure Java version (2850L/17K).

scope tempNewPing_addToStack

asclass #StackEntry implements Runnable {
  Runnable previous;
  
  *(Runnable *previous) {}
  
  abstract void impl();
  
  run {
    impl();
    callF(previous);
  }
}

static AutoCloseable tempNewPing_addToStack(Thread thread default currentThread(), Runnable r) {
  if (r == null) null;
  var tl = newPing_actionTL();
  var old = tl.get();
  tl.set(new StackEntry(old) {
    void impl { r.run(); }
  });
  ret () -> { tl.set(old); };
}

end scope

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031415
Snippet name: tempNewPing_addToStack
Eternal ID of this version: #1031415/7
Text MD5: 412cd86ea15c4822bc892699e9c2bf46
Transpilation MD5: 348e5a8f4c671e9124f038f71cbf31ea
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-20 05:02:07
Source code size: 505 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 243 / 337
Version history: 6 change(s)
Referenced in: [show references]