text: public void DecRef(){EnsureOpen();int rc = refCount.DecrementAndGet();if (rc == 0){bool success = false;try{DoClose();closed = true;success = true;}finally{if (!success){refCount.IncrementAndGet();}}}else if (rc < 0){throw new ThreadStateException("too many decRef calls: refCount is " + rc + " after decrement");}}