summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/libc/pthread.go
diff options
context:
space:
mode:
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))
}
}