diff options
| author | Naveen Michaud-Agrawal <naveen.michaudagrawal@gmail.com> | 2023-11-23 00:50:32 +0000 |
|---|---|---|
| committer | Naveen Michaud-Agrawal <naveen.michaudagrawal@gmail.com> | 2023-11-23 00:50:32 +0000 |
| commit | ee4cc9489355cd9a480ae7737bd0cf3c0e893ba0 (patch) | |
| tree | 7acbb5d02c6a7cd90a91b6fc94e80aaae6b000c0 /lib | |
| parent | print: Hack to forward Hex House print requests to folk0 (diff) | |
| download | folk-ee4cc9489355cd9a480ae7737bd0cf3c0e893ba0.tar.gz folk-ee4cc9489355cd9a480ae7737bd0cf3c0e893ba0.zip | |
Clear mailbox of unmatched processes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/peer.tcl | 4 | ||||
| -rw-r--r-- | lib/process.tcl | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/peer.tcl b/lib/peer.tcl index 42297e4a..e8e18be8 100644 --- a/lib/peer.tcl +++ b/lib/peer.tcl @@ -34,6 +34,10 @@ proc ::peer {process {dieOnDisconnect false}} { variable process Mailbox::receive $process $::thisProcess } + proc clear {} { + variable process + Mailbox::clear $process $::thisProcess + } proc share {shareStatements} { variable process diff --git a/lib/process.tcl b/lib/process.tcl index faaa5e84..c9adec0a 100644 --- a/lib/process.tcl +++ b/lib/process.tcl @@ -115,6 +115,8 @@ proc Start-process {name body} { } } On unmatch { + # Clear the mailbox + ::Peers::${name}::clear # Remember to suppress/kill the process if it shows up # later after we're gone. dict set ::peersBlacklist $name true |
