Adding thread timeout for audio recorer thread in Java

BUG=NONE

Review URL: https://codereview.webrtc.org/1444313002

Cr-Commit-Position: refs/heads/master@{#10671}
This commit is contained in:
henrika
2015-11-17 04:28:26 -08:00
committed by Commit bot
parent e66339296b
commit fd614c2149
3 changed files with 11 additions and 31 deletions

View File

@ -23,6 +23,7 @@ import android.os.Process;
import android.os.SystemClock;
import org.webrtc.Logging;
import org.webrtc.ThreadUtils;
class WebRtcAudioRecord {
private static final boolean DEBUG = false;
@ -103,12 +104,8 @@ class WebRtcAudioRecord {
public void joinThread() {
keepAlive = false;
while (isAlive()) {
try {
join();
} catch (InterruptedException e) {
// Ignore.
}
if (!ThreadUtils.joinUninterruptibly(this, 1000)) {
Logging.e(TAG, "Timeout in WebRtcAudioRecord.joinThread()");
}
}
}