public static EnumSet <TEnum> GetInstance() { //slight chance there might end up being two instances, but don't really care that much //unless changed frequently, shouldn't be a problem. var ret = TheValue.Value; if (ret == null) { var temp = new EnumSet <TEnum>(); TheValue.TrySet(temp); ret = TheValue.Value ?? temp; } Debug.Assert(ret != null); return(ret); }
public static bool ReleaseCache() { return(TheValue.TryClear()); }