refcnt

package
v0.0.0-...-ad801e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RefCountable

type RefCountable interface {
	// IncRef increments the reference count.
	IncRef() int32

	// DecRef decrements the reference count.
	// When the reference count goes to zero,
	// an optional callback is executed.
	DecRef() int32

	// RefCount returns the current reference count.
	RefCount() int32
}

RefCountable is an object that is reference counted.

type RefCounter

type RefCounter struct {
	// contains filtered or unexported fields
}

RefCounter is a reference counter.

func NewRefCounter

func NewRefCounter() *RefCounter

NewRefCounter creates a new reference counter, with an initial refcount of 1.

func (*RefCounter) DecRef

func (c *RefCounter) DecRef() int32

DecRef decrements the ref count, and optionally executes the callback where applicable.

func (*RefCounter) IncRef

func (c *RefCounter) IncRef() int32

IncRef increments the ref count.

func (*RefCounter) RefCount

func (c *RefCounter) RefCount() int32

RefCount returns the current reference count.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL