Improved Decoder test()
@@ -215,6 +215,10 @@ public class NeuralDecoder extends Decoder implements DecoderWithNBest, DataList
if (now - lastSuccessfulTranslation < 5000L)
return;
+ synchronized (this) {
+ if (now - lastSuccessfulTranslation < 5000L)
+ return;
+
PythonDecoder decoder = null;
try {
decoder = decoderQueue.take(null);
@@ -226,6 +230,7 @@ public class NeuralDecoder extends Decoder implements DecoderWithNBest, DataList
decoderQueue.release(decoder);
}
}
+ }
// DataListenerProvider
