svn path=/trunk/mcs/; revision=31389
@@ -1,3 +1,8 @@
+2004-07-21 Geoff Norton <[email protected]>
+
+ * Hashtable.cs: lock the SyncRoot when Cloning a Synchronized hashtable to avoid
+ a snapshot out of sync error.
2004-07-21 Duncan Mak <[email protected]>
* DictionaryBase.cs: Rename the dictionary field to hashtable,
@@ -1114,8 +1114,9 @@ namespace System.Collections {
public override object Clone ()
{
- Hashtable ht = (Hashtable) host.Clone ();
- return new SyncHashtable (ht);
+ lock(host.SyncRoot) {
+ return new SyncHashtable( (Hashtable) host.Clone () );
+ }
}
} // SyncHashtable