Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Unified Diff: talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java

Issue 1356293002: Android: Add class ThreadUtils with helper function joinUninterruptibly() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rename to ThreadUtils and add extra comment Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | talk/app/webrtc/java/android/org/webrtc/ThreadUtils.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java
diff --git a/talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java b/talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java
index 7e56e700c2e6f62acbb4bb4bc7f12d7b09d67ea1..7b3b3ddc3d45aabec9b5ecffef87695a4bd2a061 100644
--- a/talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java
+++ b/talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java
@@ -195,23 +195,8 @@ public class SurfaceViewRenderer extends SurfaceView
}
}
// The |renderThread| cleanup is not safe to cancel and we need to wait until it's done.
- boolean wasInterrupted = false;
- while (true) {
- try {
- renderThread.join();
- renderThread = null;
- break;
- } catch (InterruptedException e) {
- // Someone is asking us to return early at our convenience. We can't cancel this cleanup,
- // but we should preserve the information and pass it along. Any rendering in progress
- // should complete in a few ms.
- wasInterrupted = true;
- }
- }
- // Pass interruption information along.
- if (wasInterrupted) {
- Thread.currentThread().interrupt();
- }
+ ThreadUtils.joinUninterruptibly(renderThread);
+ renderThread = null;
}
/**
« no previous file with comments | « no previous file | talk/app/webrtc/java/android/org/webrtc/ThreadUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698