public ulong AcquireWeakReference(T thing) { ulong id = 0; lock(this) { id = NextId++; references.Add(id, new WeakReference(thing)); } return id; }