init: v1.0.0

This commit is contained in:
yaole
2026-05-27 23:03:00 +08:00
commit 8d97f750eb
466 changed files with 80067 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package internal
import (
"sync"
"testing"
"github.com/stretchr/testify/assert"
)
func TestSpinlock(t *testing.T) {
var l SpinLock
var n uint64
var wg sync.WaitGroup
for i := 0; i < 10000; i++ {
wg.Add(1)
go func() {
for i := 0; i < 10000; i++ {
l.Lock()
n++
l.Unlock()
}
wg.Done()
}()
}
wg.Wait()
assert.Equal(t, n, uint64(10000)*10000)
}