sync: Made doc comment on Gate.Close make more sense

This commit is contained in:
Sasha Koshka 2025-01-26 00:11:17 -05:00
parent fd85de4a44
commit c4e2a0f641

View File

@ -51,7 +51,7 @@ func (this *Gate[T]) Receive () <- chan T {
return this.load() return this.load()
} }
// Close closes the gate, drains all remaining messages, and closes the channel. // Close closes the gate, unblocking any send or receive operations.
func (this *Gate[T]) Close () error { func (this *Gate[T]) Close () error {
channel := this.channel.Swap((chan T)(nil)).(chan T) channel := this.channel.Swap((chan T)(nil)).(chan T)
if channel == nil { return ErrAlreadyClosed } if channel == nil { return ErrAlreadyClosed }