sync: Made doc comment on Gate.Close make more sense
This commit is contained in:
parent
fd85de4a44
commit
c4e2a0f641
@ -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 }
|
||||||
|
Loading…
Reference in New Issue
Block a user