]> Cypherpunks repositories - gostls13.git/commit
runtime: make stack barrier locking more robust
authorAustin Clements <austin@google.com>
Thu, 19 Nov 2015 18:26:43 +0000 (13:26 -0500)
committerAustin Clements <austin@google.com>
Mon, 23 Nov 2015 19:13:15 +0000 (19:13 +0000)
commit22e57c6655288e129fa807eecf936fdf5ac2ced8
tree1faca9cc0effe406091c7108ad47dbf9acd1f62d
parent041787280976d0bad15c646fc7c7bbfef76d7ee5
runtime: make stack barrier locking more robust

The stack barrier locking functions use a simple cas lock because they
need to support trylock, but currently don't increment g.m.locks. This
is okay right now because they always run on the system stack or the
signal stack and are hence non-preemtible, but this could lead to
difficult-to-reproduce deadlocks if these conditions change in the
future.

Make these functions more robust by incrementing g.m.locks and making
them nosplit to enforce non-preemtibility.

Change-Id: I73d60a35bd2ad2d81c73aeb20dbd37665730eb1b
Reviewed-on: https://go-review.googlesource.com/17058
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ingo Oeser <nightlyone@googlemail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mstkbar.go