Return correctly-sized ProcessThreadCollection to enable Threads.Count.
authorScott Blomquist <scott@blomqui.st>
Sun, 29 Jul 2012 23:50:17 +0000 (16:50 -0700)
committerScott Blomquist <scott@blomqui.st>
Sun, 29 Jul 2012 23:51:01 +0000 (16:51 -0700)
mcs/class/System/System.Diagnostics/Process.cs

index d22a75dd76e03dc959226457663b181d15ecc715..29f0e1a687192fc1c4c6aa66e5ec7e78a0683bac 100644 (file)
@@ -685,11 +685,13 @@ namespace System.Diagnostics {
                }
 
                [MonoTODO]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden), Browsable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The number of threads of this process.")]
                public ProcessThreadCollection Threads {
                        get {
-                               return ProcessThreadCollection.GetEmpty ();
+                               // This'll return a correctly-sized array of empty ProcessThreads for now.
+                               int error;
+                               return new ProcessThreadCollection(new ProcessThread[GetProcessData (pid, 0, out error)]);
                        }
                }