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

21
LINES

< > BotCompany Repo | #1029625 // Lock interruption test (OK)

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

Download Jar. Libraryless. Click here for Pure Java version (7444L/52K).

1  
!7
2  
3  
// Test is OK when interruption message shows the stack trace as reason
4  
5  
p-exp {
6  
  Lock lock = lock();
7  
  
8  
  Thread a = thread "A" {
9  
    lock lock;
10  
    sleepSeconds(10);
11  
  };
12  
  
13  
  Thread b = thread "B" {
14  
    sleepSeconds(1);
15  
    lock lock;
16  
    sleepSeconds(10);
17  
  };
18  
  
19  
  sleepSeconds(3);
20  
  interruptThread(b);
21  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029625
Snippet name: Lock interruption test (OK)
Eternal ID of this version: #1029625/4
Text MD5: 1ce5d40705e52870368021b071ba337d
Transpilation MD5: 82d683458bd51e607b5ac57fd4ea25c5
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-30 20:02:31
Source code size: 335 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 310 / 906
Version history: 3 change(s)
Referenced in: [show references]