public static void AddExtraEncoding(String name, IExtraEncoding enc) {
lock (extraEncodings) { // This serializes concurrent updates
Hashtable newEncodings = (Hashtable)extraEncodings.Clone();
newEncodings[name.ToLower(System.Globalization.CultureInfo.InvariantCulture)] = enc;
extraEncodings = newEncodings; // This swap does not require synchronization with reader
}
}