go-trylock icon indicating copy to clipboard operation
go-trylock copied to clipboard

TryLock support on read-write lock for Golang

Results 1 go-trylock issues
Sort by recently updated
recently updated
newest added

https://github.com/subchen/go-trylock/blob/6894780a9a5161a47127990acaebf7d2d8fc4fd5/trylock.go#L120 ``` func (m *trylocker) RTryLock(ctx context.Context) bool { for { n := atomic.LoadInt32(m.state) if n >= 0 { if atomic.CompareAndSwapInt32(m.state, n, n+1) { // acquire OK return true }...