package module
v0.8.0 Latest Latest

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 2 Imported by: 1




View Source
const DefaultCapacity = 1024

DefaultCapacity defines default local store slots capacity.


This section is empty.


This section is empty.


type LocalStore

type LocalStore struct {
	Store map[int64]uintptr
	// contains filtered or unexported fields

LocalStore defines rw mutex lock; limited slots capacity; allocation free; goroutine local storage implementation. It exposes store directly to avoid stack store copies.

func LStore

func LStore(cap ...int64) *LocalStore

LStore singleton local storage fetch.

func (*LocalStore) Del

func (ls *LocalStore) Del()

Del removes local goroutine storage value frees single capacity slot.

func (*LocalStore) RLock added in v0.8.0

func (ls *LocalStore) RLock() int64

RLock defines manual read locking operation.

func (*LocalStore) RUnlock added in v0.8.0

func (ls *LocalStore) RUnlock()

RUnlock defines manual read unlocking operation.

func (*LocalStore) Set

func (ls *LocalStore) Set(v uintptr)

Set sets local goroutine storage value if there any free capacity slot avaliable.

Jump to

Keyboard shortcuts

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