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

14
LINES

< > BotCompany Repo | #1009293 // startDeadlockDetector - starts a thread that checks for deadlocks regularly; cancels when first deadlock found

JavaX fragment (include)

static Var<java.util.Timer> startDeadlockDetector_timer = new Var;
static int startDeadlockDetector_interval;
static bool startDeadlockDetector_noStop; // don't stop when deadlock found

static void startDeadlockDetector() {
  synchronized(startDeadlockDetector_timer) {
    if (startDeadlockDetector_timer! == null)
      startDeadlockDetector_timer.set(doEvery_daemon(1000, func {
        if (empty(printDeadlocks())) null;
        if (startDeadlockDetector_noStop) { print("Stopping deadlock detector."); false; }
        null;
      }));
  }
}

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: #1009293
Snippet name: startDeadlockDetector - starts a thread that checks for deadlocks regularly; cancels when first deadlock found
Eternal ID of this version: #1009293/7
Text MD5: b093739c29dec4ef0df18f70edbe1356
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-23 15:20:12
Source code size: 560 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 513 / 532
Version history: 6 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)