Skip to content

Commit 70ea70e

Browse files
runtime: rename p racectx field to raceprocctx
Both g and p had a racectx field, but they held different kinds of values. The g field held ThreadState values while the p field held Processor values (to use the names used in the C++ code in the compiler_rt support library). Rename the p field to raceprocctx to reduce potential confusion. Change-Id: Iefba0e259d240171e973054c452c3c15bf3f8f8f Reviewed-on: https://go-review.googlesource.com/c/go/+/169960 Reviewed-by: Dmitry Vyukov <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 154e5ab commit 70ea70e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/runtime/proc.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3956,12 +3956,12 @@ func procresize(nprocs int32) *p {
39563956
pp.mcache = allocmcache()
39573957
}
39583958
}
3959-
if raceenabled && pp.racectx == 0 {
3959+
if raceenabled && pp.raceprocctx == 0 {
39603960
if old == 0 && i == 0 {
3961-
pp.racectx = raceprocctx0
3961+
pp.raceprocctx = raceprocctx0
39623962
raceprocctx0 = 0 // bootstrap
39633963
} else {
3964-
pp.racectx = raceproccreate()
3964+
pp.raceprocctx = raceproccreate()
39653965
}
39663966
}
39673967
}
@@ -4019,8 +4019,8 @@ func procresize(nprocs int32) *p {
40194019
gfpurge(p)
40204020
traceProcFree(p)
40214021
if raceenabled {
4022-
raceprocdestroy(p.racectx)
4023-
p.racectx = 0
4022+
raceprocdestroy(p.raceprocctx)
4023+
p.raceprocctx = 0
40244024
}
40254025
p.gcAssistTime = 0
40264026
p.status = _Pdead

src/runtime/race_amd64.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ TEXT runtime·racecallbackthunk(SB), NOSPLIT, $56-8
398398
MOVQ g(RARG0), RARG0
399399
MOVQ g_m(RARG0), RARG0
400400
MOVQ m_p(RARG0), RARG0
401-
MOVQ p_racectx(RARG0), RARG0
401+
MOVQ p_raceprocctx(RARG0), RARG0
402402
MOVQ RARG0, (RARG1)
403403
RET
404404

src/runtime/race_ppc64le.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ TEXT runtime·racecallbackthunk(SB), NOSPLIT, $-8
455455
MOVD 0(R13)(R10*1), g
456456
MOVD g_m(g), R3
457457
MOVD m_p(R3), R3
458-
MOVD p_racectx(R3), R3
458+
MOVD p_raceprocctx(R3), R3
459459
MOVD R3, (R4)
460460
MOVD R9, g // restore R30 ??
461461
RET

src/runtime/runtime2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ type p struct {
482482
sysmontick sysmontick // last tick observed by sysmon
483483
m muintptr // back-link to associated m (nil if idle)
484484
mcache *mcache
485-
racectx uintptr
485+
raceprocctx uintptr
486486

487487
deferpool [5][]*_defer // pool of available defer structs of different sizes (see panic.go)
488488
deferpoolbuf [5][32]*_defer

0 commit comments

Comments
 (0)