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

5
LINES

< > BotCompany Repo | #1012933 // tempSetThreadLocal

JavaX fragment (include)

static <A> AutoCloseable tempSetThreadLocal(final ThreadLocal<A> tl, A a) {
  if (tl == null) null;
  final A prev = setThreadLocal(tl, a);
  ret autoCloseable { tl.set(prev); };
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012933
Snippet name: tempSetThreadLocal
Eternal ID of this version: #1012933/5
Text MD5: 93ab61719a552cdfaaaddf94788e9cd6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-03 02:52:38
Source code size: 184 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 488 / 569
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1013270 - temp_setThreadLocal - synonym of tempSetThreadLocal
#1016243 - tempSetField
#1016885 - tempSetThreadLocalOpt
#1019865 - tempSetVar
#1031638 - tempSetThreadLocalIfNecessary - compares with existing value first