diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2008-11-20 23:40:55 +0300 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2008-11-20 23:40:55 +0300 |
commit | adcaff89cc3a02c06475c456f00c2248ec0ae9c6 (patch) | |
tree | 72a6be4174f8b414fcda74ca7262355d2e47dac9 /mcs/class/System/System.Diagnostics/PerformanceCounter.cs | |
parent | 75883dc733e1e318c83ff2eab3c408d2926301f3 (diff) |
2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
* PerformanceCounter.cs: add 2 workarounds for known problems. I will
add the corresponding test cases later.
svn path=/trunk/mcs/; revision=119506
Diffstat (limited to 'mcs/class/System/System.Diagnostics/PerformanceCounter.cs')
-rw-r--r-- | mcs/class/System/System.Diagnostics/PerformanceCounter.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounter.cs b/mcs/class/System/System.Diagnostics/PerformanceCounter.cs index 11ba430550c..d29edfc7d94 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounter.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounter.cs @@ -160,8 +160,10 @@ namespace System.Diagnostics { if (!is_custom) readOnly = true; // invalid counter, need to handle out of mem - if (impl == IntPtr.Zero) - throw new InvalidOperationException (); + + // TODO: reenable this + //if (impl == IntPtr.Zero) + // throw new InvalidOperationException (); changed = false; } @@ -328,8 +330,11 @@ namespace System.Diagnostics { { if (changed) UpdateInfo (); - if (readOnly) - throw new InvalidOperationException (); + if (readOnly) { + // FIXME: This should really throw, but by now set this workaround in place. + //throw new InvalidOperationException (); + return 0; + } return UpdateValue (impl, true, value); } |