Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReferenceCounter ¶
type ReferenceCounter struct {
// contains filtered or unexported fields
}
ReferenceCounter is a reference counter which allows you to safely close a resource when it's no longer in use.
func (*ReferenceCounter) Acquire ¶
func (c *ReferenceCounter) Acquire() bool
Acquire adds a reference
func (*ReferenceCounter) Close ¶
func (c *ReferenceCounter) Close() bool
Close closes the resource when the last reference is released
func (*ReferenceCounter) Release ¶
func (c *ReferenceCounter) Release() bool
Release releases a reference
Click to show internal directories.
Click to hide internal directories.