From 502b5dd65fa56ae092bd3fb35ab18c45f2cc354f Mon Sep 17 00:00:00 2001 From: Judah Caruso Date: Sat, 6 Dec 2025 22:44:52 -0700 Subject: [PATCH] . --- spmd/spmd.go | 4 ++-- xx.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spmd/spmd.go b/spmd/spmd.go index ba74e41..c52cf41 100644 --- a/spmd/spmd.go +++ b/spmd/spmd.go @@ -58,7 +58,7 @@ func Run(nLanes int, fn func(lane Lane)) { osthread.Start(func() { s := new(state) - s.cond = sync.NewCond(&s.mtx) + s.cond.L = &s.mtx s.total = uint64(nLanes) var wg sync.WaitGroup @@ -82,7 +82,7 @@ func Run(nLanes int, fn func(lane Lane)) { type state struct { mtx sync.Mutex - cond *sync.Cond + cond sync.Cond waiting atomic.Uint64 total uint64 userdata sync.Map diff --git a/xx.go b/xx.go index 7bbbb05..daaea87 100644 --- a/xx.go +++ b/xx.go @@ -30,6 +30,7 @@ func Clone[T any](value *T) *T { return Copy(new(T), value) } +// BoolUint converts a boolean to an integer. func BoolUint(b bool) uint { return uint(*(*uint8)(unsafe.Pointer(&b))) }