public void Serialize(IOutputArchive archive, string tag) { lock (locker) { archive.StartRecord(this, "node"); archive.WriteBuffer(data, "data"); archive.WriteLong(acl, "acl"); stat.Serialize(archive, "statpersisted"); archive.EndRecord(this, "node"); } }
public void Serialize(IOutputArchive archive, string tag) { try { SpinWait.SpinUntil(() => Interlocked.CompareExchange(ref lockedInt, 1, 0) == 0); archive.StartRecord(this, "node"); archive.WriteBuffer(data, "data"); archive.WriteLong(acl, "acl"); stat.Serialize(archive, "statpersisted"); archive.EndRecord(this, "node"); } finally { Interlocked.Exchange(ref lockedInt, 0); } }