golocal

package module
v0.8.0 Latest Latest
Warning

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 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultCapacity = 1024

DefaultCapacity defines default local store slots capacity.

Variables

This section is empty.

Functions

This section is empty.

Types

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
⌂ 换网址