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

19
LINES

< > BotCompany Repo | #1015954 // Test InheritableThreadLocal (OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (4370L/31K).

!7

static new InheritableThreadLocal<S> tl;

p {
  thread {
    tl.set("thread1");
    assertEqualsVerbose("thread1", tl!);
    thread {
      assertEqualsVerbose("thread1", tl!);
    }
  }
  
  thread {
    assertEqualsVerbose(null, tl!);
  }
  
  sleepSeconds(1); // Too lazy to join threads
}

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: #1015954
Snippet name: Test InheritableThreadLocal (OK)
Eternal ID of this version: #1015954/3
Text MD5: 5aae4203d9ebdad1b76a4f395fa2e868
Transpilation MD5: 408336e2f9e762b6e8657ac8d6300b3b
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-31 22:14:19
Source code size: 316 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 511 / 1194
Version history: 2 change(s)
Referenced in: [show references]