Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a deadlock in EngineResource/Engine.
Engine acquires it's lock, then the EngineResource lock when it loads resources from cache or active resources. EngineResource acquires its lock, then the EngineLock, when a resource is cleared. This conflicting lock order leads to deadlock. The fix is similar to the fix applied in ActiveResources. We always make sure that the Engine (listener) lock is acquired before the EngineResource lock. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=233861929
- Loading branch information
92d8cc4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2 main
java.lang.NullPointerException
Null reference used for synchronization (monitor-enter)
1 com.bumptech.glide.load.engine.EngineResource.release(SourceFile:107)
2 com.bumptech.glide.load.engine.Engine.release(SourceFile:286)
3 com.bumptech.glide.request.SingleRequest.releaseResource(SourceFile:340)
4 com.bumptech.glide.request.SingleRequest.clear(SourceFile:330)
5 com.bumptech.glide.manager.RequestTracker.clearRemoveAndMaybeRecycle(SourceFile:79)
6 com.bumptech.glide.manager.RequestTracker.clearRemoveAndRecycle(SourceFile:66)
7 com.bumptech.glide.RequestManager.untrack(SourceFile:630)
8 com.bumptech.glide.RequestManager.untrackOrDelegate(SourceFile:598)
9 com.bumptech.glide.RequestManager.clear(SourceFile:594)
10 com.bumptech.glide.request.target.PreloadTarget.clear(SourceFile:57)
11 com.bumptech.glide.request.target.PreloadTarget$1.handleMessage(SourceFile:25)
12 android.os.Handler.dispatchMessage(Handler.java:102)
13 android.os.Looper.loop(Looper.java:164)
14 android.app.ActivityThread.main(ActivityThread.java:6906)
15 java.lang.reflect.Method.invoke(Native Method)
16 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
17 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:820)