コード例 #1
0
        public void Commit(long position, long count)
        {
            long lazyCursorValue = Cursor.VolatileGet();

            var positionToWait = position - count;

            if (positionToWait <= lazyCursorValue)
            {
                WaitStrategy.WaitFor(positionToWait, Cursor);
            }

            Cursor.VolatileSet(position + 1);
            WaitStrategy.Signal();
        }
コード例 #2
0
        public void Commit(long position, long count)
        {
            long lazyCursorValue = Cursor.Get();
            //BUG: single thread writer could not rely on wait strategy because cursor must be moved by itself. Self-deadlock.
            var positionToWait = position - count;

            if (positionToWait <= lazyCursorValue)
            {
                WaitStrategy.WaitFor(positionToWait, Cursor);
            }

            Cursor.VolatileSet(position + 1);
            WaitStrategy.Signal();
        }