minor additions

This commit is contained in:
Judah Caruso 2025-12-06 22:33:23 -07:00
parent 19effc40a6
commit 1a56df57f9
3 changed files with 20 additions and 0 deletions

View file

@ -1 +1,13 @@
//go:build !XX_DISABLE_ASSERT
package xx
func Assert(cond bool) {
if !cond {
panic("assertion failed")
}
}
func Unreachable() {
panic("unreachable")
}

View file

@ -1 +1,7 @@
//go:build XX_DISABLE_ASSERT
package xx
func Assert(cond bool) {}
func Unreachable() {}

View file

@ -114,12 +114,14 @@ func (l Lane) Sync() {
}
// Store sends 'value' to all lanes.
//
// Store can be called concurrently.
func (l Lane) Store(key, value any) {
l.state.userdata.Store(key, value)
}
// Load fetches a named value, returning nil if it does not exist.
//
// Load can be called concurrently.
func (l Lane) Load(key any) any {
v, ok := l.state.userdata.Load(key)