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

19
LINES

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

JavaX fragment (include)

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

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/6
Text MD5: 45abf7a3df70fbac08bb05f09e2c3ccc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-01 03:37:18
Source code size: 346 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 47 / 86
Version history: 5 change(s)
Referenced in: [show]