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.

static void unlock(Lock lock, S msg) {
  if (lock == null) ret;
  lock.unlock();
  vmBus_send unlocked(lock, thread := currentThread());
  print("Unlocked: " + msg); // print afterwards to make sure the lock is always unlocked
}

static void unlock(Lock lock) {
  if (lock == null) ret;
  lock.unlock();
  vmBus_send unlocked(lock, thread := currentThread());
}

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: 546 / 711
Version history: 8 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)