Hashtable.IsSynchronized Property gets a value indicating whether access to the Hashtable is synchronized (thread safe).
using System;
using System.Collections;
public class SamplesHashtable {
public static void Main() {
Hashtable myHT = new Hashtable();
myHT.Add( 0, "zero" );
myHT.Add( 1, "one" );
myHT.Add( 2, "two" );
Hashtable mySyncdHT = Hashtable.Synchronized( myHT );
Console.WriteLine( "myHT is {0}.", myHT.IsSynchronized ? "synchronized" : "not synchronized" );
Console.WriteLine( "mySyncdHT is {0}.", mySyncdHT.IsSynchronized ? "synchronized" : "not synchronized" );
}
}
Related examples in the same category