aboutsummaryrefslogtreecommitdiffstats
path: root/kill.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-08-22 21:12:12 -0400
committerSam Anthony <sam@samanthony.xyz>2024-08-22 21:12:12 -0400
commitd8743bbc53c8db43151ef89d21264b531bea3d4c (patch)
treeba941b7aa904bbde985d3a76ca90028f4bf8a475 /kill.go
parent59cf78dbab8549761207b706f9856898cb5cd9c2 (diff)
downloadgui-d8743bbc53c8db43151ef89d21264b531bea3d4c.zip
test attachHandler
Diffstat (limited to 'kill.go')
-rw-r--r--kill.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/kill.go b/kill.go
index 81ab8ad..d6c2b3b 100644
--- a/kill.go
+++ b/kill.go
@@ -28,9 +28,9 @@ type attachable interface {
// If attachHandler is killed while a victim is attached, it kills the victim.
// When killed, the victim must detach itself before dying.
type attachHandler struct {
- attach chan<- attachable
- kill chan<- bool
- dead <-chan bool
+ attachChan chan<- attachable
+ kill chan<- bool
+ dead <-chan bool
}
func newAttachHandler() attachHandler {
@@ -65,3 +65,7 @@ func newAttachHandler() attachHandler {
return attachHandler{attach, kill, dead}
}
+
+func (ah attachHandler) attach() chan<- attachable {
+ return ah.attachChan
+}