(tid, reason)
| 369 | } |
| 370 | |
| 371 | function stopStalk(tid, reason) { |
| 372 | const state = stalked.get(tid); |
| 373 | if (!state) return; |
| 374 | try { Stalker.unfollow(tid); } catch (e) {} |
| 375 | try { Stalker.flush(); } catch (e) {} |
| 376 | stalked.delete(tid); |
| 377 | stalkedCount--; |
| 378 | console.log(`${C.red}[stalk-]${C.reset} ${PID}:${state.name}#${tid} ${C.dim}events=${state.count}${state.dropped ? ` dropped=${state.dropped}` : ""} reason=${reason || "thread exit"} @+${tms()}ms${C.reset}`); |
| 379 | } |
| 380 | |
| 381 | // --- the observer ----------------------------------------------------------- |
| 382 | const threadObs = Process.attachThreadObserver({ |
no test coverage detected