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

17
LINES

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

JavaX fragment (include)

static void lock(Lock lock) ctex {
  lock.lockInterruptibly();
}

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

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   

Travelled to 3 computer(s): cfunsshuasjs, onxytkatvevr, tvejysmllsmz

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/5
Text MD5: 95c4517772461870c65f93a8e3c20024
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-24 01:43:14
Source code size: 324 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 40 / 70
Version history: 4 change(s)
Referenced in: [show]