mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Threading: Fix rare multi-thread error for Hiero parser
This commit is contained in:
parent
3b4a3a5af5
commit
2776790369
@ -9,6 +9,6 @@
|
|||||||
<classpathentry kind="lib" path="lib/mysql-connector-java-5.1.12-bin.jar"/>
|
<classpathentry kind="lib" path="lib/mysql-connector-java-5.1.12-bin.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/postgresql-8.4-701.jdbc4.jar"/>
|
<classpathentry kind="lib" path="lib/postgresql-8.4-701.jdbc4.jar"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.8.11.2.jar"/>
|
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.18.0.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
@ -22,6 +22,7 @@ class Hiero_parser {
|
|||||||
private Hiero_block cur_block;
|
private Hiero_block cur_block;
|
||||||
private Bry_bfr cur_tkn = Bry_bfr_.Reset(16);
|
private Bry_bfr cur_tkn = Bry_bfr_.Reset(16);
|
||||||
public Hiero_block[] Parse(byte[] src, int bgn, int end) {
|
public Hiero_block[] Parse(byte[] src, int bgn, int end) {
|
||||||
|
synchronized (blocks) { // TS:needed b/c blocks, cur_block, etc are member vars DATE:2017-05-26
|
||||||
blocks.Clear();
|
blocks.Clear();
|
||||||
this.cur_block = new Hiero_block();
|
this.cur_block = new Hiero_block();
|
||||||
cur_tkn.Clear();
|
cur_tkn.Clear();
|
||||||
@ -65,6 +66,7 @@ class Hiero_parser {
|
|||||||
this.New_block();// flush remaining items
|
this.New_block();// flush remaining items
|
||||||
return (Hiero_block[])blocks.To_ary_and_clear(Hiero_block.class);
|
return (Hiero_block[])blocks.To_ary_and_clear(Hiero_block.class);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private void New_block() {
|
private void New_block() {
|
||||||
this.New_token(null);
|
this.New_token(null);
|
||||||
if (cur_block.Len() > 0) {
|
if (cur_block.Len() > 0) {
|
||||||
|
@ -1 +1 @@
|
|||||||
update
|
download_central update
|
||||||
|
Loading…
Reference in New Issue
Block a user