@@ -10,16 +10,13 @@ namespace System.IO.Ports
1010 /// <summary>
1111 /// This class is used to keep tabs on what serial ports are open.
1212 /// </summary>
13- internal sealed class SerialDeviceController
13+ internal static class SerialDeviceController
1414 {
1515 // this is used as the lock object
1616 // a lock is required because multiple threads can access the SerialDevice controller
17+ [ System . Diagnostics . DebuggerBrowsable ( Diagnostics . DebuggerBrowsableState . Never ) ]
1718 private static object _syncLock ;
1819
19- // we can have only one instance of the SerialDeviceController
20- // need to do a lazy initialization of this field to make sure it exists when called elsewhere.
21- private static SerialDeviceController s_instance ;
22-
2320 // backing field for DeviceCollection
2421 private static ArrayList s_deviceCollection ;
2522
@@ -57,30 +54,5 @@ internal static ArrayList DeviceCollection
5754 s_deviceCollection = value ;
5855 }
5956 }
60-
61- /// <summary>
62- /// Gets the default serial device controller for the system.
63- /// </summary>
64- /// <returns>The default GPIO controller for the system, or null if the system has no GPIO controller.</returns>
65- internal static SerialDeviceController GetDefault ( )
66- {
67- if ( s_instance == null )
68- {
69- if ( _syncLock == null )
70- {
71- _syncLock = new object ( ) ;
72- }
73-
74- lock ( _syncLock )
75- {
76- if ( s_instance == null )
77- {
78- s_instance = new SerialDeviceController ( ) ;
79- }
80- }
81- }
82-
83- return s_instance ;
84- }
8557 }
8658}
0 commit comments