add worker thread tracking
add stGen which gets bumped for every worker thread spawned by loadBook every thread captures stGen when it spawns and before actually loading the book in the main thread, and in the worker thread it checks if myGen == stGen this throws away stale requests, meaning if you try and load another book while one is still loading, it will ignore the one still loading and start loading the latest request
This commit is contained in:
parent
f6ec5c20d8
commit
81c2caaf67
3 changed files with 39 additions and 26 deletions
|
|
@ -18,5 +18,6 @@ initialState title path =
|
|||
stIndex = ChapterIndex 0,
|
||||
stZoom = 1.0,
|
||||
stTitle = title,
|
||||
stBookPath = path
|
||||
stBookPath = path,
|
||||
stGen = 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue