• Russ Cox's avatar
    runtime: use cas loop to coordinate with sigprof · e0f08b93
    Russ Cox authored
    sigprof and setcpuprofilerate coordinate the enabling/disabling
    of the handler using a Mutex. This has always been a bit dodgy:
    setcpuprofilerate must be careful to turn off signals before acquiring
    the lock to avoid a deadlock.
    
    Now the lock implementations use onM, and onM isn't okay on the
    signal stack. We know how to make it okay, but it's more work than
    is probably worth doing.
    
    Since this is super-dodgy anyway, replace the lock with a simple
    cas loop. It is only contended if setcpuprofilerate is being called,
    and that doesn't happen frequently enough to care about the
    raw speed or about using futexes/semaphores.
    
    TBR to fix freebsd/amd64 and dragonfly/amd64 builds.
    Happy to make changes in a follow-up CL.
    
    TBR=dvyukov
    CC=golang-codereviews
    https://golang.org/cl/141080044
    e0f08b93
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...