Skip to content

Commit

Permalink
2005-05-04 Miguel de Icaza <miguel@novell.com>
Browse files Browse the repository at this point in the history
	* Enum.cs (MonoEnumInfo): Based on a patch from James Willcox,
	initialize cache as a static method.  Fixes #74828.

svn path=/branches/mono-1-1-7/mcs/; revision=44059
  • Loading branch information
migueldeicaza committed May 5, 2005
1 parent ea0d5e5 commit f7f844a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 8 additions & 3 deletions mcs/class/corlib/System/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
2005-05-04 Miguel de Icaza <miguel@novell.com>

* Enum.cs (MonoEnumInfo): Based on a patch from James Willcox,
initialize cache as a static method. Fixes #74828.

2005-05-03 Marek Safar <marek.safar@seznam.cz>
* Console.cs: CancelKeyPress is stubbed.

* Console.cs: CancelKeyPress is stubbed.

2005-04-25 Sebastien Pouliot <sebastien@ximian.com>

* ActivationContext.cs: Updated for beta2.
Expand Down
7 changes: 5 additions & 2 deletions mcs/class/corlib/System/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ internal struct MonoEnumInfo

[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)
{
Expand All @@ -59,8 +64,6 @@ private MonoEnumInfo (MonoEnumInfo other)

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];
Expand Down

0 comments on commit f7f844a

Please sign in to comment.