Skip to content

Commit

Permalink
fix synchronize bug (synchronized must use an object)
Browse files Browse the repository at this point in the history
  • Loading branch information
hg42 committed Aug 13, 2022
1 parent 740bfbf commit cc82202
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,10 @@ class WorkHandler(appContext: Context) {
val batchesKnown = mutableMapOf<String, BatchState>()
var batchesStarted = -1

var lockProgress = object {}

fun onProgress(handler: WorkHandler, workInfos: MutableList<WorkInfo>? = null) {
synchronized(batchesStarted) {
synchronized(lockProgress) {
onProgressNoSync(handler, workInfos)
}
}
Expand Down

0 comments on commit cc82202

Please sign in to comment.