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

8
LINES

< > BotCompany Repo | #1012424 // temporarilySetThreadLocal - returns an AutoCloseable

JavaX fragment (include)

static <A> AutoCloseable temporarilySetThreadLocal(final ThreadLocal<A> tl, A value) {
  final A oldValue = setThreadLocal(tl, value);
  ret new AutoCloseable {
    public void close() {
      tl.set(oldValue);
    }
  };
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012424
Snippet name: temporarilySetThreadLocal - returns an AutoCloseable
Eternal ID of this version: #1012424/2
Text MD5: e80e312466145f8a115466cd25c294b5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-02 17:33:12
Source code size: 230 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 403 / 427
Version history: 1 change(s)
Referenced in: [show references]