• Ian Lance Taylor's avatar
    runtime: fix crash in select · 26d95d80
    Ian Lance Taylor authored
    runtime.park() can access freed select descriptor
    due to a racing free in another thread.
    See the comment for details.
    
    Slightly modified version of dvyukov's CL 9259045.
    
    No test yet.  Before this CL, the test described in issue 5422
    would fail about every 40 times for me.  With this CL, I ran
    the test 5900 times with no failures.
    
    Fixes #5422.
    
    R=golang-dev, r
    CC=golang-dev
    https://golang.org/cl/9311043
    26d95d80
chan.c 26.9 KB