We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 184ce0c commit 2d1fd47Copy full SHA for 2d1fd47
System.IO.Ports/SerialDeviceEventListener.cs
@@ -37,7 +37,7 @@ public bool OnEvent(BaseEvent ev)
37
var serialDataEvent = (SerialDataEvent)ev;
38
SerialPort device = null;
39
40
- lock (_serialDevicesMap)
+ lock (_serialDevicesMap.SyncRoot)
41
{
42
device = FindSerialDevice(serialDataEvent.SerialDeviceIndex);
43
}
@@ -53,15 +53,15 @@ public bool OnEvent(BaseEvent ev)
53
54
public void AddSerialDevice(SerialPort device)
55
56
57
58
_serialDevicesMap.Add(device);
59
60
61
62
public void RemoveSerialDevice(int index)
63
64
65
66
var device = FindSerialDevice(index);
67
0 commit comments