Syntax:
SyncRoot
This property returns a synchronization object for the current array. Arrays are not inherently thread-safe. Synchronize Access to the array with the synchronization object.
virtual object SyncRoot{ get;}
Example:
Accesses to arrays are easily synchronized with the lock statement, where the SyncRoot object is the parameter.
Thread t2=new Thread(
new ThreadStart(DisplayReverse));
t1.Start();
t2.Start();
RL();
}
private static int [] zArray={1,5,4,2,4,2,9,10};
public static void DisplayForward() {
lock(zArray.SyncRoot) {
Console.Write(" Forward: "
0000"> void Break()
o(∩_∩)o...