• Sokolov Yura's avatar
    runtime: fix using fastrand in sema.go · 9d9722a2
    Sokolov Yura authored
    Before CL 62530 fastrand always returned non-zero value, and one
    condition in sema.go depends on this behavior.
    
    fastrand is used to generate random weight for treap of sudog, and
    it is checked against zero to verify sudog were inserted into treap or
    wait queue.
    
    Since its precision is not very important for correctness, lets just
    always set its lowest bit in this place.
    
    Updates #22047
    Updates #21806
    
    Change-Id: Iba0b56d81054e6ef9c49ffd293fc5d92a6a31e9b
    Reviewed-on: https://go-review.googlesource.com/68050Reviewed-by: 's avatarAustin Clements <austin@google.com>
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    9d9722a2
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...