mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
sharedmem: clarify cleanup in comments
PiperOrigin-RevId: 507838107
This commit is contained in:
committed by
gVisor bot
parent
8373fb5db8
commit
efea407471
@@ -191,6 +191,9 @@ type endpoint struct {
|
||||
|
||||
// New creates a new shared-memory-based endpoint. Buffers will be broken up
|
||||
// into buffers of "bufferSize" bytes.
|
||||
//
|
||||
// In order to release all resources held by the returned endpoint, Close()
|
||||
// must be called followed by Wait().
|
||||
func New(opts Options) (stack.LinkEndpoint, error) {
|
||||
e := &endpoint{
|
||||
mtu: opts.MTU,
|
||||
@@ -231,7 +234,8 @@ func New(opts Options) (stack.LinkEndpoint, error) {
|
||||
return e, nil
|
||||
}
|
||||
|
||||
// Close frees all resources associated with the endpoint.
|
||||
// Close frees most resources associated with the endpoint. Wait() must be
|
||||
// called after Close() in order to free the rest.
|
||||
func (e *endpoint) Close() {
|
||||
// Tell dispatch goroutine to stop, then write to the eventfd so that
|
||||
// it wakes up in case it's sleeping.
|
||||
|
||||
Reference in New Issue
Block a user