Removed unnecessary synchronization.

This commit is contained in:
akwizgran
2012-11-27 00:09:33 +00:00
parent 116e194185
commit 4869a8034b

View File

@@ -80,13 +80,11 @@ class ModemPlugin implements DuplexPlugin, Modem.Callback {
return false; return false;
} }
// Synchronized to avoid a race condition with resetModem() public void stop() {
public synchronized void stop() {
running = false; running = false;
} }
// Synchronized to avoid a race condition with stop() private boolean resetModem() {
private synchronized boolean resetModem() {
if(!running) return false; if(!running) return false;
for(String portName : SerialPortList.getPortNames()) { for(String portName : SerialPortList.getPortNames()) {
modem = modemFactory.createModem(this, portName); modem = modemFactory.createModem(this, portName);