~suranap/+junk/concur.net

« back to all changes in this revision

Viewing changes to Concurrency/ConcurrentSkipList.cs

  • Committer: U-Scooby\Pinku Surana
  • Date: 2009-08-27 04:19:00 UTC
  • Revision ID: surana@scooby-20090827041900-lypm1j2cjvyu62nj
Make Node.topLayer a property instead of a field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
        class Node
15
15
        {
16
16
            internal T key;
17
 
            internal int topLayer;
18
17
            internal Node[] nexts;
19
18
            internal volatile bool marked = false;
20
19
            internal volatile bool fullyLinked = false;
 
20
            internal int topLayer { get { return nexts.Length - 1; } }
21
21
 
22
22
            internal Node(T k, int height)
23
23
            {
24
24
                key = k;
25
 
                topLayer = height - 1;
26
25
                nexts = new Node[height];
27
26
            }
28
27
        }
62
61
        {
63
62
            int? lFound = null;
64
63
            Node pred = LSentinel;
 
64
 
65
65
            for (int layer = MaxHeight - 1; layer >= 0; layer--)
66
66
            {
67
67
                Node curr = pred.nexts[layer];