- Support go version range
go1.18
~go1.23
(New supportgo1.23
).
- Fix interface conversion error: getting nil value from ThreadLocal[T], where T is interface type.
- Update copyright.
- Support go version range
go1.18
~go1.21
. - Support
generic
programming.
- Support go version range
go1.13
~go1.21
(New supportgo1.21
). - Support capture values of
InheritableThreadLocal
byWrapTask()
,WrapWaitTask()
andWrapWaitResultTask()
methods. - Support run
FutureTask
byFutureTask.Run()
method. - Define function type
Runnable
andFutureCallable
.
- Rename type
Future
toFutureTask
. - Skip first runtime panic stack automatically for
RuntimeError
.
- Support go version range
go1.13
~go1.20
(New supportgo1.20
).
- Fix a memory leak risk caused by Timer.
- Reduce memory by using less chan.
- Update copyright.
- Support more arch
loong64
,mips
,mipsle
,mips64
,mips64le
,ppc64le
,riscv64
,wasm
.
- Upgrade dependencies to the latest version.
- Modify continuous integration script to support go1.19.
- Support arch
386
&amd64
onfreebsd
and archppc64
&s390x
onlinux
. - Support
Cancel()
andGetWithTimeout()
methods for typeFuture
. - Support checking whether the tasks created by
GoWait(CancelRunnable)
andGoWaitResult(CancelCallable)
methods are canceled.
- Fix spell error of type
Future
. - Rename type
Any
toany
.
- Rename
StackError
toRuntimeError
. - Support error nesting for
RuntimeError
. - Beautify the error message of
RuntimeError
. - Remove
bytesconv.Bytes()
andbytesconv.String()
methods. - Restore to the previous value if an overflow occurs when getting the index of
ThreadLocal
.
- Fix released
thread
struct may be resurrected from invalid memory and cause fault error.
- Modify the error message format of
StackError
. - Define function type
Supplier
forthreadLocal
andinheritableThreadLocal
types. - Define function type
Runnable
andCallable
forGo(Runnable)
,GoWait(Runnable)
andGoWaitResult(Callable)
methods.
- Fix fault error when pprof is running.
- Support more architectures
386
,amd64
,armv6
,armv7
,arm64
.
- Read and write
coroutine
information through thegohack
library, theoretically support unreleasedgo
versions in the future. - When
runtime.g
cannot be obtained natively,panic
directly instead of falling back to invokeruntime.Stack()
method. - Remove api
ThreadLocal.Id()
.
- Support go version range
go1.13
~go1.18
(New supportgo1.18
).
- Change license to
Apache-2.0
. - Upgrade dependencies to the latest version.
- Add zero-copy conversion method between
bytes
andstring
, seebytesconv.Bytes()
andbytesconv.String()
methods.
- Modify the garbage collection mechanism, remove
gcTimer
, no longer perform garbage collection through timers. - Store the context in the
g.labels
field of the coroutine structure which will be set tonil
after coroutine ends. The context data will be collected at the nextGC
. - Use
go:linkname
to invoke assembly codegetg()
directly to improve performance. - Implement the
getGoidByStack()
method by invokehttp.http2curGoroutineID()
. - Remove api
AllGoids()
andForeachGoid()
.
- Support copy
Cloneable
objects to sub goroutine when create sub goroutines byGo()
,GoWait()
andGoWaitResult()
methods. - Add api
ForeachGoid(func(goid int64))
to run a func for each goid.
- Support go version range
go1.13
~go1.17
(Not supportgo1.12
anymore). - Use segment locks to reduce competition and improve
ThreadLocal
'sread
,write
andgc
performance. - Get all goids through
runtime.allgs
instead ofruntime.atomicAllG
, sogo1.13
~go1.15
can also get all goids natively.
- Fix bug in
getAllGoidByStack()
method, Buffer may too small when dump all stack info.
- Support initialize value when first get from
ThreadLocal
. - Add
StackError
to catch stack info. - Add
Feature
to wait goroutine finished or get result from goroutine. - Add api
NewThreadLocalWithInitial()
,NewInheritableThreadLocal()
andNewInheritableThreadLocalWithInitial()
. - Support Inherit values of
ThreadLocal
byGo
,GoWait()
andGoWaitResult()
.
- Rename
LocalStorage
toThreadLocal
. - Remove api
Clear()
,InheritContext()
andRestoreContext()
. - Improve
gc
performance by reducing the number of for loops.
- Improve performance by use slice to store goroutine local values.
- Optimize
clearDeadStore()
method.
This is the first stable version available for production. It is highly recommended to upgrade to this version if you have used a previous version.
- Fix
NewLocalStorage()
always return the same value, so we can define multiLocalStorage
instances. - Fix
NewLocalStorage()
clear otherLocalStorage
's value. - Fix
RestoreContext()
not clear values when restore from empty*ImmutableContext
.
- Not force create
store
when invokeGet()
,Remove()
,Clear()
,BackupContext()
methods to reduce memory usage.
- Rename
InheritContext()
toRestoreContext()
. - Rename
Del()
toRemove()
. - Move Clear() method to
routine
package.
- Support go version range
go1.12
~go1.17
(New supportgo1.17
). - Enable GitHub actions for continuous integration.
NewLocalStorage()
always return the same value.
- Support go version range
go1.12
~go1.16
. - Support
Goid()
to get current goroutine id. - Support
AllGoids
to get all goroutine ids. - Support
ThreadLocal
to save values ingo to goroutine.
NewLocalStorage()
always return the same value.