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

12
LINES

< > BotCompany Repo | #1007381 // unlock - release Lock with optional message

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

Transpiled version (2784L) is out of date.

1  
static void unlock(Lock lock, S msg) {
2  
  if (lock == null) ret;
3  
  lock.unlock();
4  
  vmBus_send unlocked(lock, thread := currentThread());
5  
  print("Unlocked: " + msg); // print afterwards to make sure the lock is always unlocked
6  
}
7  
8  
static void unlock(Lock lock) {
9  
  if (lock == null) ret;
10  
  lock.unlock();
11  
  vmBus_send unlocked(lock, thread := currentThread());
12  
}

Author comment

Began life as a copy of #1007380

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, xrpafgyirdlv

No comments. add comment

Snippet ID: #1007381
Snippet name: unlock - release Lock with optional message
Eternal ID of this version: #1007381/9
Text MD5: b22f2a2bb28431e22f4fae2dfe655728
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 21:16:29
Source code size: 372 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 431 / 529
Version history: 8 change(s)
Referenced in: [show references]