• Austin Clements's avatar
    runtime: protect sudog.elem with hchan.lock · db72b41b
    Austin Clements authored
    Currently sudog.elem is never accessed concurrently, so in several
    cases we drop the channel lock just before reading/writing the
    sent/received value from/to sudog.elem. However, concurrent stack
    shrinking is going to have to adjust sudog.elem to point to the new
    stack, which means it needs a way to synchronize with accesses to
    sudog.elem. Hence, add sudog.elem to the fields protected by
    hchan.lock and scoot the unlocks down past the uses of sudog.elem.
    
    While we're here, better document the channel synchronization rules.
    
    For #12967.
    
    Change-Id: I3ad0ca71f0a74b0716c261aef21b2f7f13f74917
    Reviewed-on: https://go-review.googlesource.com/20040Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    db72b41b
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...