Skip to content

Commit

Permalink
fix jruby multithreaded runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
kermitt2 committed Aug 20, 2020
1 parent 6551c95 commit 70e4239
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -3,6 +3,7 @@
import org.jruby.embed.PathType;
import org.jruby.embed.ScriptingContainer;
import org.jruby.embed.LocalContextScope;
import org.jruby.embed.LocalVariableBehavior;

import org.grobid.core.lang.SentenceDetector;
import org.grobid.core.utilities.OffsetPosition;
Expand Down Expand Up @@ -37,7 +38,7 @@ public PragmaticSentenceDetector() {
loadPaths.add(segmenterLoadPath);
loadPaths.add(unicodeLoadPath);

instance = new ScriptingContainer(LocalContextScope.THREADSAFE);
instance = new ScriptingContainer(LocalContextScope.CONCURRENT, LocalVariableBehavior.PERSISTENT);
instance.setClassLoader(instance.getClass().getClassLoader());
instance.setLoadPaths(loadPaths);
instance.runScriptlet(PathType.ABSOLUTE, segmenterRbFile);
Expand Down

0 comments on commit 70e4239

Please sign in to comment.