sync: throw, not panic, for unlock of unlocked mutex
The panic leaves the lock in an unusable state. Trying to panic with a usable state makes the lock significantly less efficient and scalable (see early CL patch sets and discussion). Instead, use runtime.throw, which will crash the program directly. In general throw is reserved for when the runtime detects truly serious, unrecoverable problems. This problem is certainly serious, and, without a significant performance hit, is unrecoverable. Fixes #13879. Change-Id: I41920d9e2317270c6f909957d195bd8b68177f8d Reviewed-on: https://go-review.googlesource.com/31359Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Showing
Please register or sign in to comment