]> git.sesse.net Git - stockfish/commit
Fix profile-build
authorMarco Costalba <mcostalba@gmail.com>
Tue, 8 Nov 2011 06:34:44 +0000 (07:34 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 8 Nov 2011 06:39:06 +0000 (07:39 +0100)
commitc2600a73cfcde2958351bf7fd4dc7296b137223b
tree9527892099f87dc77d92750f8e1e688a6e50e539
parent43204d9ac210a3a68b7b9785f3089d38412c1375
Fix profile-build

After async I/O patches 'bench' changed behaviour and now waits for
input at the end of the test run. This is due to listener thread stay
blocked on std::getline() even after test run is finished, as soon as
we feed something the thread unblocks and then quickly exits.

This is not a big problem, but has the bad side effect of breaking
profile builds that hang forever at the end of the test run.

The tricky workaround is to create a pipe that connects to stockfish
input and then, when test run is finished, breaking the pipe: this
makes std::getline() immediately return.

So this patch adds a 'sleep 10' piped into 'stockfish bench' test run
command. After 10 seconds sleep ends, the pipe breaks and 'bench'
finishes as usual.

Thanks to Oliver Korff for reporting the issue, and to Mike Whiteley
for having co-authored this solution.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/Makefile