summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/libc/pthread.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2025-02-14 16:54:10 +0000
committerLibravatar GitHub <noreply@github.com>2025-02-14 16:54:10 +0000
commitebbdeee0bb91d5008a405e43114f1653ecdf8ce8 (patch)
treed9b1c087a34e6f5947d553f7cb04503b3c411e93 /vendor/modernc.org/libc/pthread.go
parent[bugfix] Drop status indices AFTER updating visibility (#3795) (diff)
downloadgotosocial-ebbdeee0bb91d5008a405e43114f1653ecdf8ce8.tar.xz
bump modernc.org/sqlite to v1.35.0-concurrency-workaround (#3797)
Diffstat (limited to 'vendor/modernc.org/libc/pthread.go')
-rw-r--r--vendor/modernc.org/libc/pthread.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/vendor/modernc.org/libc/pthread.go b/vendor/modernc.org/libc/pthread.go
index 802503225..3d8bc0b84 100644
--- a/vendor/modernc.org/libc/pthread.go
+++ b/vendor/modernc.org/libc/pthread.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !(linux && (amd64 || arm64 || loong64))
+//go:build !(linux && (amd64 || arm64 || loong64 || ppc64le || s390x || riscv64 || 386 || arm))
package libc // import "modernc.org/libc"
@@ -421,6 +421,8 @@ func (m *mutex) lock(id int32) int32 {
// shall return zero; otherwise, an error number shall be returned to indicate
// the error.
switch m.typ {
+ default:
+ fallthrough
case pthread.PTHREAD_MUTEX_NORMAL:
// If the mutex type is PTHREAD_MUTEX_NORMAL, deadlock detection shall not be
// provided. Attempting to relock the mutex causes deadlock. If a thread
@@ -450,8 +452,6 @@ func (m *mutex) lock(id int32) int32 {
// intentional empty section - wake up other waiters
m.wait.Unlock()
}
- default:
- panic(todo("", m.typ))
}
}
@@ -461,6 +461,8 @@ func (m *mutex) tryLock(id int32) int32 {
}
switch m.typ {
+ default:
+ fallthrough
case pthread.PTHREAD_MUTEX_NORMAL:
return errno.EBUSY
case pthread.PTHREAD_MUTEX_RECURSIVE:
@@ -480,8 +482,6 @@ func (m *mutex) tryLock(id int32) int32 {
m.Unlock()
return errno.EBUSY
- default:
- panic(todo("", m.typ))
}
}
@@ -494,6 +494,8 @@ func (m *mutex) unlock() int32 {
// shall return zero; otherwise, an error number shall be returned to indicate
// the error.
switch m.typ {
+ default:
+ fallthrough
case pthread.PTHREAD_MUTEX_NORMAL:
// If the mutex type is PTHREAD_MUTEX_NORMAL, deadlock detection shall not be
// provided. Attempting to relock the mutex causes deadlock. If a thread
@@ -511,8 +513,6 @@ func (m *mutex) unlock() int32 {
}
m.Unlock()
return 0
- default:
- panic(todo("", m.typ))
}
}