Jason.... If you do not explicitly declare the access modifier, then the
default
accessibility for class and struct members is private. private static
members are
useful for thread safe identifiers.
// static stuff
private static int uniqueID= 0;
private static int GetUniqueID()
{
lock(typeof(TestStatic))
{
return uniqueID++; // returns zero at start
}
}
Alternatively you can lock on a syncLock object.
Regards,
Jeff
*** Sent via Developersdex
http://www.developersdex.com ***