runtime: avoid race checking for preemption
Moving the "don't really preempt" check up earlier in the function introduced a race where gp.stackguard0 might change between the early check and the later one. Since the later one is missing the "don't really preempt" logic, it could decide to preempt incorrectly. Pull the result of the check into a local variable and use an atomic to access stackguard0, to eliminate the race. I believe this will fix the broken OS X and Solaris builders. Change-Id: I238350dd76560282b0c15a3306549cbcf390dbff Reviewed-on: https://go-review.googlesource.com/2823Reviewed-by:Austin Clements <austin@google.com>
Showing
Please register or sign in to comment