geometer/FBReaderJ — pull request #145 by dennis-sheil (2013-06-22 06:53:36+00:00)
Title: Kludge to fix serious race condition

On some Android devices, clicking through OPDS catalogs, a large percentage of the time you will get the emptyCatalog message ("Catalog is empty, sorry"). On clicking reload you will usually get the catalog loaded correctly.

This seems due to some kind of problem with how mutual exclusion is done. It seems there is some kind of race condition.

This is a bad problem and has been around for months, at least. It is a big problem - sometimes new users will click OPDS and see nothing, not know to click reload and give up. Even for users who know to click reload it can be annoying to continually click reload.

This fix is kludgey but its behavior seems to be better than the existing behavior. One question is, how long does this commit delay the load of a long loading normal sized catalog load? Another question is, how does it deal with very large catalog pages? In both cases I believe the behavior of this commit is better than its predecessor.

This commit is definitely kludgey and I'm sure a more elegant fix can be done, but this fix is all I have time for at the moment.