fix intermittent thread-safety failure in contrib/benchmark unit test

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@602475 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2007-12-08 14:17:07 +00:00
parent b0d2b1c90e
commit 86ca6f86d7
1 changed files with 1 additions and 1 deletions

View File

@ -347,7 +347,7 @@ public class TestPerfTasksLogic extends TestCase {
/** use reuters and the exhaust mechanism, but to be faster, add 20 docs only... */ /** use reuters and the exhaust mechanism, but to be faster, add 20 docs only... */
public static class Reuters20DocMaker extends ReutersDocMaker { public static class Reuters20DocMaker extends ReutersDocMaker {
private int nDocs=0; private int nDocs=0;
protected DocData getNextDocData() throws Exception { protected synchronized DocData getNextDocData() throws Exception {
if (nDocs>=20 && !forever) { if (nDocs>=20 && !forever) {
throw new NoMoreDataException(); throw new NoMoreDataException();
} }