Commit dbd66fd3 authored by Zhou Peng's avatar Zhou Peng Committed by Brad Fitzpatrick

runtime: use debugSelect flag to toggle debug code

This block of code once was commented by the original author, but commenting
code looks a little annoying. However, the debugSelect flag is just for the
situation that debug code will be compiled when debuging, when release this
code will be eliminated by the compiler.

Change-Id: I7b94297e368b515116ef44a36058214ddddf9adb
Reviewed-on: https://go-review.googlesource.com/113395Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent a0b70517
...@@ -191,14 +191,15 @@ func selectgo(cas0 *scase, order0 *uint16, ncases int) (int, bool) { ...@@ -191,14 +191,15 @@ func selectgo(cas0 *scase, order0 *uint16, ncases int) (int, bool) {
} }
lockorder[j] = o lockorder[j] = o
} }
/*
if debugSelect {
for i := 0; i+1 < ncases; i++ { for i := 0; i+1 < ncases; i++ {
if scases[lockorder[i]].c.sortkey() > scases[lockorder[i+1]].c.sortkey() { if scases[lockorder[i]].c.sortkey() > scases[lockorder[i+1]].c.sortkey() {
print("i=", i, " x=", lockorder[i], " y=", lockorder[i+1], "\n") print("i=", i, " x=", lockorder[i], " y=", lockorder[i+1], "\n")
throw("select: broken sort") throw("select: broken sort")
} }
} }
*/ }
// lock all the channels involved in the select // lock all the channels involved in the select
sellock(scases, lockorder) sellock(scases, lockorder)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment