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


< > BotCompany Repo | #1007380 - lock - acquire Lock with message; also lock() is a synonym of fairLock()

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

Libraryless. Click here for Pure Java version (2539L/16K).

static void lock(Lock lock) ctex {
  if (lock == null) ret;
  try {
  } catch (InterruptedException e) {
    O reason = vm_threadInterruptionReasonsMap().get(currentThread());
    print("Locking interrupted! Reason: " + strOr(reason, "Unknown");
  // NO call to ping here! Make sure lock is always released.

static void lock(Lock lock, S msg) {
  print("Locking: " + msg);

static void lock(Lock lock, S msg, long timeout) {
  print("Locking: " + msg);
  lockOrFail(lock, timeout);

static ReentrantLock lock() {
  ret fairLock();

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007380
Snippet name: lock - acquire Lock with message; also lock() is a synonym of fairLock()
Eternal ID of this version: #1007380/13
Text MD5: ad57ecd01187421baa83e94a2acb5b1e
Transpilation MD5: dbc1cc81acaa1b685beae9437fbb704e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-30 19:53:17
Source code size: 663 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 448 / 524
Version history: 12 change(s)
Referenced in: [show references]

Formerly at &