summaryrefslogtreecommitdiffstats
path: root/libgo/go/sync/mutex_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/sync/mutex_test.go')
-rw-r--r--libgo/go/sync/mutex_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/libgo/go/sync/mutex_test.go b/libgo/go/sync/mutex_test.go
index d0e048ed7a4..f5c20ca49b4 100644
--- a/libgo/go/sync/mutex_test.go
+++ b/libgo/go/sync/mutex_test.go
@@ -89,3 +89,16 @@ func BenchmarkContendedMutex(b *testing.B) {
<-c
<-c
}
+
+func TestMutexPanic(t *testing.T) {
+ defer func() {
+ if recover() == nil {
+ t.Fatalf("unlock of unlocked mutex did not panic")
+ }
+ }()
+
+ var mu Mutex
+ mu.Lock()
+ mu.Unlock()
+ mu.Unlock()
+}
OpenPOWER on IntegriCloud