mirror of
https://github.com/sigmasternchen/sudoku-solver
synced 2025-03-14 23:38:57 +00:00
check for chan size exhaustion
This commit is contained in:
parent
4362be5345
commit
53a9d2ea36
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
@ -444,6 +444,12 @@ func main() {
|
|||
fmt.Printf("queued: %10d, remaining: %10d, eliminated: %d (+ %d) \r", len(guesses), possibilities, globalEliminated, len(eliminatedChan))
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
|
||||
if len(guesses) == guessChanSize {
|
||||
fmt.Println()
|
||||
fmt.Println("possible deadlock; increase guessChanSize (current value: ", guessChanSize, ")")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if len(solution) > 0 {
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue