diff options
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r-- | src/runtime/runtime2.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 109f0da131..9a032d8658 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -537,10 +537,13 @@ type m struct { syscalltick uint32 freelink *m // on sched.freem - // mFixup is used to synchronize OS related m state (credentials etc) - // use mutex to access. + // mFixup is used to synchronize OS related m state + // (credentials etc) use mutex to access. To avoid deadlocks + // an atomic.Load() of used being zero in mDoFixupFn() + // guarantees fn is nil. mFixup struct { lock mutex + used uint32 fn func(bool) bool } |