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

17
LINES

< > BotCompany Repo | #1031670 // cancelForeignThread - this whole thing should be reformed

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3207L/19K).

1  
svoid cancelForeignThread(Thread t) {
2  
  if (t == null) ret;
3  
  O mc = getMainClassForThread(t);
4  
  if (mc == null) ret with print("Can't find main class for thread " + t);
5  
  ping();
6  
  Map ping_actions = cast get(mc, 'ping_actions);
7  
  if (ping_actions == null) ret with print("No ping_actions");
8  
  synchronized(ping_actions) {
9  
    ping_actions.put(t, "cancelled");
10  
    set(mc, ping_anyActions := true);
11  
    print("Cancelled foreign thread: " + t);
12  
  }
13  
}
14  
15  
svoid cancelForeignThread(long threadID) {
16  
  cancelForeignThread(getThreadByID(threadID));
17  
}

Author comment

Began life as a copy of #1004549

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031670
Snippet name: cancelForeignThread - this whole thing should be reformed
Eternal ID of this version: #1031670/3
Text MD5: c443a7c9bcaf06ddabbd41348645644e
Transpilation MD5: 72571768c2d273907b4c9b12e09d4441
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-25 13:02:57
Source code size: 560 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 184 / 263
Version history: 2 change(s)
Referenced in: [show references]