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:
@ -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()");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user