Switch from ScheduledExecutorService to ExecutorService.

ScheduledExecutorService silently ignores exceptions thrown by the
runnable. This makes debugging issues unnecessarily difficult.

Bug: None
Change-Id: I7deb43b96e5639c096b9aed9c6ff9b197b62f59f
Reviewed-on: https://chromium-review.googlesource.com/521084
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18378}
This commit is contained in:
Sami Kalliomäki
2017-06-01 13:14:44 +02:00
committed by Commit Bot
parent ab84272272
commit 2a8856cc4a

View File

@ -27,7 +27,7 @@ import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ExecutorService;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.appspot.apprtc.AppRTCClient.SignalingParameters;
@ -103,7 +103,7 @@ public class PeerConnectionClient {
private static final PeerConnectionClient instance = new PeerConnectionClient();
private final PCObserver pcObserver = new PCObserver();
private final SDPObserver sdpObserver = new SDPObserver();
private final ScheduledExecutorService executor;
private final ExecutorService executor;
private PeerConnectionFactory factory;
private PeerConnection peerConnection;
@ -289,7 +289,7 @@ public class PeerConnectionClient {
// Executor thread is started once in private ctor and is used for all
// peer connection API calls to ensure new peer connection factory is
// created on the same thread as previously destroyed factory.
executor = Executors.newSingleThreadScheduledExecutor();
executor = Executors.newSingleThreadExecutor();
}
public static PeerConnectionClient getInstance() {