Implements a thread-safe ISet wrapper.
Namespace: Iesi.Collections
Assembly: Iesi.Collections (in Iesi.Collections)
Version: 1.0.0.3
Syntax
| Visual Basic (Declaration) |
|---|
<SerializableAttribute> _ Public NotInheritable Class SynchronizedSet _ Inherits Set |
| C# |
|---|
[SerializableAttribute] public sealed class SynchronizedSet : Set |
| Visual C++ |
|---|
[SerializableAttribute] public ref class SynchronizedSet sealed : public Set |
Remarks
The implementation is extremely conservative, serializing critical sections
to prevent possible deadlocks, and locking on everything. The one exception
is for enumeration, which is inherently not thread-safe. For this, you have
to lock the SyncRoot object for the duration
of the enumeration.