shared.go 188 Bytes
Newer Older
Jeromy's avatar
Jeromy committed
1
2
3
4
5
6
7
8
9
10
package buffer

func BothClosed(in *Inbound, out *Outbound) (closed bool) {
	in.L.Lock()
	out.L.Lock()
	closed = (in.err != nil && out.err != nil)
	out.L.Unlock()
	in.L.Unlock()
	return
}