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

29
LINES

< > BotCompany Repo | #1012126 // Test cancelledLiveThreads (OK)

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

Download Jar. Libraryless. Click here for Pure Java version (2269L/15K).

!7

p {
  Thread t = startThread("Whoopsie", r {
    while licensed {
      print("sleeping");
      sleep(1000);
      print("done sleeping");
    }
  });
    
  assertEmpty(cancelledLiveThreads());
  print("cancelling");
  cancelThread(t);
  assertNempty(cancelledLiveThreads());
  t = null;

  while licensed {
    gc();
    L<Thread> threads = cancelledLiveThreads();
    print(threads);
    if (empty(threads)) break;
    threads = null;
    sleep(100);
  }
  
  assertEmpty(cancelledLiveThreads());
  print("OK");
}

Author comment

Began life as a copy of #1012125

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: #1012126
Snippet name: Test cancelledLiveThreads (OK)
Eternal ID of this version: #1012126/3
Text MD5: 6cad82d0b028b23ea29763442e33e0ac
Transpilation MD5: 2bcc97bab6dbea9d6350ddc7eb8696bf
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-20 11:56:14
Source code size: 549 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 276 / 692
Version history: 2 change(s)
Referenced in: [show references]