Author: miguel
Date: 2005-05-04 22:28:20 -0400 (Wed, 04 May 2005)
New Revision: 44059
Modified:
branches/mono-1-1-7/mcs/class/corlib/System/ChangeLog
branches/mono-1-1-7/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: branches/mono-1-1-7/mcs/class/corlib/System/ChangeLog
===================================================================
--- branches/mono-1-1-7/mcs/class/corlib/System/ChangeLog 2005-05-05
02:27:47 UTC (rev 44058)
+++ branches/mono-1-1-7/mcs/class/corlib/System/ChangeLog 2005-05-05
02:28:20 UTC (rev 44059)
@@ -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: branches/mono-1-1-7/mcs/class/corlib/System/Enum.cs
===================================================================
--- branches/mono-1-1-7/mcs/class/corlib/System/Enum.cs 2005-05-05 02:27:47 UTC
(rev 44058)
+++ branches/mono-1-1-7/mcs/class/corlib/System/Enum.cs 2005-05-05 02:28:20 UTC
(rev 44059)
@@ -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