summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNaveen Michaud-Agrawal <naveen.michaudagrawal@gmail.com>2023-11-23 00:50:32 +0000
committerNaveen Michaud-Agrawal <naveen.michaudagrawal@gmail.com>2023-11-23 00:50:32 +0000
commitee4cc9489355cd9a480ae7737bd0cf3c0e893ba0 (patch)
tree7acbb5d02c6a7cd90a91b6fc94e80aaae6b000c0 /lib
parentprint: Hack to forward Hex House print requests to folk0 (diff)
downloadfolk-ee4cc9489355cd9a480ae7737bd0cf3c0e893ba0.tar.gz
folk-ee4cc9489355cd9a480ae7737bd0cf3c0e893ba0.zip
Clear mailbox of unmatched processes
Diffstat (limited to 'lib')
-rw-r--r--lib/peer.tcl4
-rw-r--r--lib/process.tcl2
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