]> Cypherpunks repositories - gostls13.git/commit
runtime: don't start GC if preemptoff is set
authorAustin Clements <austin@google.com>
Fri, 15 May 2015 20:03:27 +0000 (16:03 -0400)
committerAustin Clements <austin@google.com>
Mon, 18 May 2015 14:55:18 +0000 (14:55 +0000)
commit5f7060afd2dea927ac64804c7e4639f6635c3bb7
treef78ef4d86f8ec1a5ba9f10ab40ffd131802cc9d8
parente544bee1ddf4a2869221b68ef8cec6c97b6d827b
runtime: don't start GC if preemptoff is set

In order to avoid deadlocks, startGC avoids kicking off GC if locks
are held by the calling M. However, it currently fails to check
preemptoff, which is the other way to disable preemption.

Fix this by adding a check for preemptoff.

Change-Id: Ie1083166e5ba4af5c9d6c5a42efdfaaef41ca997
Reviewed-on: https://go-review.googlesource.com/10153
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mgc.go