bitextor / pdf-extract

PDF parser and converter to HTML
GNU General Public License v3.0
83 stars 14 forks source link

Semantics of LOADING state #35

Closed kpu closed 4 years ago

kpu commented 4 years ago

Please explain the semantics of the state LOADING.

https://github.com/bitextor/pdf-extract/blob/4ad28a23817851355ba65b6b4699a8f01b2cb760/src/pdfextract/SentenceJoin.java#L72

It seems the only way this can be visible outside the start() function is either:

  1. An Exception is thrown somewhere https://github.com/bitextor/pdf-extract/blob/4ad28a23817851355ba65b6b4699a8f01b2cb760/src/pdfextract/SentenceJoin.java#L73-L96 in which case this is a bug and it should be ERROR
  2. The start() function is entered twice for the same worker, in which case there is a race condition for the value of _workerStatus() and it's still possible to enter multiple times.