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();
        }
예제 #3
0
 public void Move(long position)
 {
     Cursor.VolatileSet(position);
     WaitStrategy.Signal();
 }