tls

package
v0.0.0-...-b08fcc5 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(k interface{})

Delete k v store, k v not thread safe

func DeleteContext

func DeleteContext()

func Flush

func Flush()

Flush clear this goroutine tls store

func For

func For(ctx context.Context, f func()) func()

func G

func G() unsafe.Pointer

G returns current g (the goroutine struct) to user space.

func Get

func Get(k interface{}) (v interface{}, exist bool)

func GetContext

func GetContext() (context.Context, bool)

func GoID

func GoID() int64

GoID get an uniq id, not as the same goroutine id

func GoIDSlow

func GoIDSlow() int64

GoID get goroutine id, this method is very slow

func Set

func Set(k, v interface{})

Set k v store, k v not thread safe

func SetContext

func SetContext(ctx context.Context)

func With

func With(f func()) func()

With will copy parent tls, not thread safe

func Wrap

func Wrap(f func()) func()

Wrap auto copy parent context

Types

This section is empty.

Jump to

Keyboard shortcuts

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