Author: miguel
Date: 2005-05-04 22:27:47 -0400 (Wed, 04 May 2005)
New Revision: 44058
Modified:
trunk/mcs/class/corlib/System/ChangeLog
trunk/mcs/class/corlib/System/Enum.cs
Log:
2005-05-04 Miguel de Icaza <[EMAIL PROTECTED]>
* Enum.cs (MonoEnumInfo): Based on a patch from James Willcox,
initialize cache as a static method. Fixes #74828.
Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog 2005-05-05 00:34:29 UTC (rev
44057)
+++ trunk/mcs/class/corlib/System/ChangeLog 2005-05-05 02:27:47 UTC (rev
44058)
@@ -1,7 +1,12 @@
+2005-05-04 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * Enum.cs (MonoEnumInfo): Based on a patch from James Willcox,
+ initialize cache as a static method. Fixes #74828.
+
2005-05-03 Marek Safar <[EMAIL PROTECTED]>
-
- * Console.cs: CancelKeyPress is stubbed.
-
+
+ * Console.cs: CancelKeyPress is stubbed.
+
2005-04-25 Sebastien Pouliot <[EMAIL PROTECTED]>
* ActivationContext.cs: Updated for beta2.
Modified: trunk/mcs/class/corlib/System/Enum.cs
===================================================================
--- trunk/mcs/class/corlib/System/Enum.cs 2005-05-05 00:34:29 UTC (rev
44057)
+++ trunk/mcs/class/corlib/System/Enum.cs 2005-05-05 02:27:47 UTC (rev
44058)
@@ -49,6 +49,11 @@
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private static extern void get_enum_info (Type enumType, out
MonoEnumInfo info);
+
+ static MonoEnumInfo ()
+ {
+ cache = Hashtable.Synchronized (new Hashtable ());
+ }
private MonoEnumInfo (MonoEnumInfo other)
{
@@ -59,8 +64,6 @@
internal static void GetInfo (Type enumType, out MonoEnumInfo
info)
{
- if (cache == null)
- cache = Hashtable.Synchronized (new Hashtable
());
lock (cache) {
if (cache.ContainsKey (enumType)) {
info = (MonoEnumInfo) cache [enumType];
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches