Commit bb4db311 authored by Geoffrey Métais's avatar Geoffrey Métais

eset previous unlock strategy

It's safer to check out of the inner loop

This reverts commit 02359fe0.
parent 23e55669
......@@ -149,6 +149,7 @@ public class Thumbnailer implements Runnable {
mVideoBrowser.resetBarrier();
lock.lock();
// Get the id of the file browser item to create its thumbnail.
boolean interrupted = false;
while (mItems.size() == 0) {
try {
if (mVideoBrowser != null) {
......@@ -158,11 +159,15 @@ public class Thumbnailer implements Runnable {
totalCount = 0;
notEmpty.await();
} catch (InterruptedException e) {
lock.unlock();
interrupted = true;
Log.i(TAG, "interruption probably requested by stop()");
break;
}
}
if (interrupted) {
lock.unlock();
break;
}
total = totalCount;
MediaWrapper item = mItems.poll();
lock.unlock();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment