// 包装后的版本 public void SetObject(string strPath, T obj, string strTimestamp = "") { if (obj == null) { SetObjectItem(strPath, null); return; } ObjectItem <T> item = new ObjectItem <T>(); item.Object = obj; item.Timestamp = strTimestamp; SetObjectItem(strPath, item); }
public void SetObjectItem(string strPath, ObjectItem <T> object_item) { this._lock.EnterWriteLock(); try { if (object_item == null) { this.m_table.Remove(strPath); return; } this.m_table[strPath] = object_item; } finally { this._lock.ExitWriteLock(); } }