dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/Generics SynchronizedCollection.cs,1


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/Generics SynchronizedCollection.cs,1.1,1.2 SynchronizedDeque.cs,1.1,1.2 SynchronizedDictionary.cs,1.2,1.3 SynchronizedList.cs,1.1,1.2 SynchronizedQueue.cs,1.2,1.3 SynchronizedSet.cs,1.1,1.2 SynchronizedStack.cs,1.2,1.3
Date: Mon, 24 Feb 2003 20:23:59 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/Generics
In directory subversions:/tmp/cvs-serv17116/Generics

Modified Files:
        SynchronizedCollection.cs SynchronizedDeque.cs 
        SynchronizedDictionary.cs SynchronizedList.cs 
        SynchronizedQueue.cs SynchronizedSet.cs SynchronizedStack.cs 
Log Message:


Lock the SyncRoot when cloning.


Index: SynchronizedCollection.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Generics/SynchronizedCollection.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** SynchronizedCollection.cs   24 Feb 2003 10:01:01 -0000      1.1
--- SynchronizedCollection.cs   25 Feb 2003 01:23:57 -0000      1.2
***************
*** 89,101 ****
        public virtual Object Clone()
                        {
!                               if(coll is ICloneable)
                                {
!                                       return new SynchronizedCollection<T>
!                                               
((ICollection<T>)(((ICloneable)coll).Clone()));
!                               }
!                               else
!                               {
!                                       throw new InvalidOperationException
!                                               (S._("Invalid_NotCloneable"));
                                }
                        }
--- 89,104 ----
        public virtual Object Clone()
                        {
!                               lock(SyncRoot)
                                {
!                                       if(coll is ICloneable)
!                                       {
!                                               return new 
SynchronizedCollection<T>
!                                                       
((ICollection<T>)(((ICloneable)coll).Clone()));
!                                       }
!                                       else
!                                       {
!                                               throw new 
InvalidOperationException
!                                                       
(S._("Invalid_NotCloneable"));
!                                       }
                                }
                        }

Index: SynchronizedDeque.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Generics/SynchronizedDeque.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** SynchronizedDeque.cs        24 Feb 2003 10:01:01 -0000      1.1
--- SynchronizedDeque.cs        25 Feb 2003 01:23:57 -0000      1.2
***************
*** 113,125 ****
        public override Object Clone()
                        {
!                               if(deque is ICloneable)
                                {
!                                       return new SynchronizedDeque<T>
!                                               
((IDeque<T>)(((ICloneable)deque).Clone()));
!                               }
!                               else
!                               {
!                                       throw new InvalidOperationException
!                                               (S._("Invalid_NotCloneable"));
                                }
                        }
--- 113,128 ----
        public override Object Clone()
                        {
!                               lock(SyncRoot)
                                {
!                                       if(deque is ICloneable)
!                                       {
!                                               return new SynchronizedDeque<T>
!                                                       
((IDeque<T>)(((ICloneable)deque).Clone()));
!                                       }
!                                       else
!                                       {
!                                               throw new 
InvalidOperationException
!                                                       
(S._("Invalid_NotCloneable"));
!                                       }
                                }
                        }

Index: SynchronizedDictionary.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Generics/SynchronizedDictionary.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** SynchronizedDictionary.cs   24 Feb 2003 23:42:49 -0000      1.2
--- SynchronizedDictionary.cs   25 Feb 2003 01:23:57 -0000      1.3
***************
*** 139,151 ****
        public override Object Clone()
                        {
!                               if(dict is ICloneable)
                                {
!                                       return new SynchronizedDictionary<T>
!                                               
((IDictionary<T>)(((ICloneable)dict).Clone()));
!                               }
!                               else
!                               {
!                                       throw new InvalidOperationException
!                                               (S._("Invalid_NotCloneable"));
                                }
                        }
--- 139,154 ----
        public override Object Clone()
                        {
!                               lock(SyncRoot)
                                {
!                                       if(dict is ICloneable)
!                                       {
!                                               return new 
SynchronizedDictionary<T>
!                                                       
((IDictionary<T>)(((ICloneable)dict).Clone()));
!                                       }
!                                       else
!                                       {
!                                               throw new 
InvalidOperationException
!                                                       
(S._("Invalid_NotCloneable"));
!                                       }
                                }
                        }

Index: SynchronizedList.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Generics/SynchronizedList.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** SynchronizedList.cs 24 Feb 2003 10:01:01 -0000      1.1
--- SynchronizedList.cs 25 Feb 2003 01:23:57 -0000      1.2
***************
*** 148,160 ****
        public override Object Clone()
                        {
!                               if(list is ICloneable)
                                {
!                                       return new SynchronizedList<T>
!                                               
((IList<T>)(((ICloneable)list).Clone()));
!                               }
!                               else
!                               {
!                                       throw new InvalidOperationException
!                                               (S._("Invalid_NotCloneable"));
                                }
                        }
--- 148,163 ----
        public override Object Clone()
                        {
!                               lock(SyncRoot)
                                {
!                                       if(list is ICloneable)
!                                       {
!                                               return new SynchronizedList<T>
!                                                       
((IList<T>)(((ICloneable)list).Clone()));
!                                       }
!                                       else
!                                       {
!                                               throw new 
InvalidOperationException
!                                                       
(S._("Invalid_NotCloneable"));
!                                       }
                                }
                        }

Index: SynchronizedQueue.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Generics/SynchronizedQueue.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** SynchronizedQueue.cs        25 Feb 2003 00:43:43 -0000      1.2
--- SynchronizedQueue.cs        25 Feb 2003 01:23:57 -0000      1.3
***************
*** 106,118 ****
        public override Object Clone()
                        {
!                               if(queue is ICloneable)
                                {
!                                       return new SynchronizedQueue<T>
!                                               
((IQueue<T>)(((ICloneable)queue).Clone()));
!                               }
!                               else
!                               {
!                                       throw new InvalidOperationException
!                                               (S._("Invalid_NotCloneable"));
                                }
                        }
--- 106,121 ----
        public override Object Clone()
                        {
!                               lock(SyncRoot)
                                {
!                                       if(queue is ICloneable)
!                                       {
!                                               return new SynchronizedQueue<T>
!                                                       
((IQueue<T>)(((ICloneable)queue).Clone()));
!                                       }
!                                       else
!                                       {
!                                               throw new 
InvalidOperationException
!                                                       
(S._("Invalid_NotCloneable"));
!                                       }
                                }
                        }

Index: SynchronizedSet.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Generics/SynchronizedSet.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** SynchronizedSet.cs  25 Feb 2003 01:19:42 -0000      1.1
--- SynchronizedSet.cs  25 Feb 2003 01:23:57 -0000      1.2
***************
*** 92,104 ****
        public override Object Clone()
                        {
!                               if(set is ICloneable)
                                {
!                                       return new SynchronizedSet<T>
!                                               
((ISet<T>)(((ICloneable)set).Clone()));
!                               }
!                               else
!                               {
!                                       throw new InvalidOperationException
!                                               (S._("Invalid_NotCloneable"));
                                }
                        }
--- 92,107 ----
        public override Object Clone()
                        {
!                               lock(SyncRoot)
                                {
!                                       if(set is ICloneable)
!                                       {
!                                               return new SynchronizedSet<T>
!                                                       
((ISet<T>)(((ICloneable)set).Clone()));
!                                       }
!                                       else
!                                       {
!                                               throw new 
InvalidOperationException
!                                                       
(S._("Invalid_NotCloneable"));
!                                       }
                                }
                        }

Index: SynchronizedStack.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Generics/SynchronizedStack.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** SynchronizedStack.cs        25 Feb 2003 00:43:43 -0000      1.2
--- SynchronizedStack.cs        25 Feb 2003 01:23:57 -0000      1.3
***************
*** 106,118 ****
        public override Object Clone()
                        {
!                               if(stack is ICloneable)
                                {
!                                       return new SynchronizedStack<T>
!                                               
((IStack<T>)(((ICloneable)stack).Clone()));
!                               }
!                               else
!                               {
!                                       throw new InvalidOperationException
!                                               (S._("Invalid_NotCloneable"));
                                }
                        }
--- 106,121 ----
        public override Object Clone()
                        {
!                               lock(SyncRoot)
                                {
!                                       if(stack is ICloneable)
!                                       {
!                                               return new SynchronizedStack<T>
!                                                       
((IStack<T>)(((ICloneable)stack).Clone()));
!                                       }
!                                       else
!                                       {
!                                               throw new 
InvalidOperationException
!                                                       
(S._("Invalid_NotCloneable"));
!                                       }
                                }
                        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]