public synchronized void publish(Revision revision) throws IOException {ensureOpen();if (currentRevision != null) {int compare = revision.compareTo(currentRevision.revision);if (compare == 0) {revision.release();return;}if (compare < 0) {revision.release();throw new IllegalArgumentException("Cannot publish an older revision: rev=" + revision + " current="+ currentRevision);}}final RefCountedRevision oldRevision = currentRevision;currentRevision = new RefCountedRevision(revision);if (oldRevision != null) {oldRevision.decRef();}checkExpiredSessions();}
public virtual void Publish(IRevision revision){lock (padlock){EnsureOpen();if (currentRevision != null){int compare = revision.CompareTo(currentRevision.Revision);if (compare == 0){revision.Release();return;}if (compare < 0){revision.Release();throw new ArgumentException(string.Format("Cannot publish an older revision: rev={0} current={1}", revision, currentRevision), "revision");}}RefCountedRevision oldRevision = currentRevision;currentRevision = new RefCountedRevision(revision);if (oldRevision != null)oldRevision.DecRef();CheckExpiredSessions();}}