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

12
LINES

< > BotCompany Repo | #1011621 // evalWithTimeoutReleasingDBLock - give the other thread a chance!

JavaX fragment (include)

static Either<O, Thread> evalWithTimeoutReleasingDBLock(int timeoutMS, fO r) {
  bool hadLock = unlockIfHolding(dbLock());
  try {
    ret assertNotNull(evalWithTimeout(timeoutMS, r));
  } finally {
    if (hadLock) lock(dbLock());
  }
}

static Either<O, Thread> evalWithTimeoutReleasingDBLock(double timeoutSeconds, fO r) {
  ret evalWithTimeoutReleasingDBLock(toMS_int(timeoutSeconds), r);
}

Author comment

Began life as a copy of #1009329

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1011621
Snippet name: evalWithTimeoutReleasingDBLock - give the other thread a chance!
Eternal ID of this version: #1011621/6
Text MD5: a5d4a3a97d851a3954cbc201d269b277
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-27 12:55:17
Source code size: 405 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 314 / 369
Version history: 5 change(s)
Referenced in: [show references]