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

28
LINES

< > BotCompany Repo | #1008280 // Test cleanUp on sleeping threads, including main thread [WORKS]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1528L/10K/34K).

!7

p {
  cleanUp_interruptThreads = true;
  assertEquals(ll(currentThread()), registeredThreads());
  
  // invoke & run module
  O o = runInSemiNewThread(#1008275);
  
  // count threads
  sleep(500);
  print(l(registeredThreads(o)));
  while (l(registeredThreads(o)) < 3) sleep(10);
  assertEquals(3, l(registeredThreads(o)));
  
  // clean up
  cleanUp(o);
  
  // see threads disappear
  sleep(500);
  print(l(registeredThreads(o)));
  print("Waiting for GC...");
  gc();
  while (l(registeredThreads(o)) > 0) sleep(10);
  
  assertEquals(1, l(registeredThreads()));
  print("OK!");
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008280
Snippet name: Test cleanUp on sleeping threads, including main thread [WORKS]
Eternal ID of this version: #1008280/15
Text MD5: b2e96a9fdc8510fe1fd38d26b7dc5b4f
Transpilation MD5: 45fcb4ea7ce20dfacb6fa9ea17777f22
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-06 23:18:37
Source code size: 616 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 437 / 561
Version history: 14 change(s)
Referenced in: [show references]