Exemplo n.º 1
0
        /// <summary>
        /// Spin-wait for enqueues, until tail or specified address, to commit to
        /// storage. Does NOT itself issue a commit, just waits for commit. So you should
        /// ensure that someone else causes the commit to happen.
        /// </summary>
        /// <param name="untilAddress">Address until which we should wait for commit, default 0 for tail of log</param>
        /// <returns></returns>
        public void WaitForCommit(long untilAddress = 0)
        {
            var tailAddress = untilAddress;

            if (tailAddress == 0)
            {
                tailAddress = allocator.GetTailAddress();
            }

            while (CommittedUntilAddress < tailAddress)
            {
                ;
            }
        }