Discover Packages
github.com/btwiuse/gmx
package
module
Version:
v0.0.2
Opens a new window with list of versions in this module.
Published: Aug 16, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 2 modules, 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.
Opens a new window with list of known importers.
README
README
¶
gmx
Generic Mutex container types for Go, inspired by Rust's
Mutex and
RwLock .
It uses new language features introduced since go1.18:
generic type
generic interface
generic function
Expand ▾
Collapse ▴
Documentation
¶
Generic Mutex container types for Go, inspired by Rust's Mutex and RwLock.
type Mutation[T any ] func(*T)
Mutation represents mutable operation on a pointer
type Mutexer[T any ] interface {
Mut(Mutation [T])
Get() T
}
Mutexer is implemented by Mx and RwMx
Generic Mutex container type
func Wrap[T any ](x *T) *Mx [T]
Wrap a pointer into Mx
Get value referenced by the wrapped pointer
Mutate wrapped value guarded by sync.RWMutex
Generic Read-Write Mutex container type
func (m *RwMx [T]) Get() T
Get value referenced by the wrapped pointer
Mutate wrapped value guarded by sync.RWMutex
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.