diff options
author | 2023-06-05 10:15:05 +0200 | |
---|---|---|
committer | 2023-06-05 10:15:05 +0200 | |
commit | b401bd1ccbce7fa547c75e9f0ae89e211112c1bb (patch) | |
tree | 08bf9ed438713e8c390ea60732e7dfc14b0d3191 /vendor/modernc.org/sqlite/lib/mutex.go | |
parent | [chore]: Bump github.com/minio/minio-go/v7 from 7.0.55 to 7.0.56 (#1869) (diff) | |
download | gotosocial-b401bd1ccbce7fa547c75e9f0ae89e211112c1bb.tar.xz |
[chore] update latest deps, ensure readme up to date (#1873)
* [chore] update latest deps, ensure readme up to date
* remove double entry
Diffstat (limited to 'vendor/modernc.org/sqlite/lib/mutex.go')
-rw-r--r-- | vendor/modernc.org/sqlite/lib/mutex.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/modernc.org/sqlite/lib/mutex.go b/vendor/modernc.org/sqlite/lib/mutex.go index be44263ae..4dd679a36 100644 --- a/vendor/modernc.org/sqlite/lib/mutex.go +++ b/vendor/modernc.org/sqlite/lib/mutex.go @@ -92,13 +92,17 @@ func mutexFromPtr(p uintptr) *mutex { if p == 0 { return nil } + ix := p - 1 + + mutexes.Lock() + defer mutexes.Unlock() + return &mutexes.a[ix>>8][ix&255] } func (m *mutexPool) alloc(recursive bool) uintptr { m.Lock() - defer m.Unlock() n := len(m.freeList) @@ -124,8 +128,8 @@ func (m *mutexPool) free(p uintptr) { ptr := mutexFromPtr(p) ix := ptr.poolIndex *ptr = mutex{} - m.Lock() + m.Lock() defer m.Unlock() m.freeList = append(m.freeList, ix) |