Skip to content

Commit 8ff9195

Browse files
author
Alex Peck
committed
upd cmts
1 parent 126a16a commit 8ff9195

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

BitFaster.Caching/Lru/LruItem.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class LruItem<K, V>
1313
private volatile bool wasAccessed;
1414
private volatile bool wasRemoved;
1515

16+
// only used when V is a non-atomic value type to prevent torn reads
1617
private int sequence;
1718

1819
/// <summary>
@@ -63,7 +64,7 @@ internal V SeqLockRead()
6364

6465
if ((start & 1) == 1)
6566
{
66-
// A write is in progress. Back off and keep spinning.
67+
// A write is in progress, spin.
6768
spin.SpinOnce();
6869
continue;
6970
}
@@ -78,7 +79,7 @@ internal V SeqLockRead()
7879
}
7980
}
8081

81-
// Note: item should be locked while invoking this method. Multiple writer threads are not supported.
82+
// Note: LruItem should be locked while invoking this method. Multiple writer threads are not supported.
8283
internal void SeqLockWrite(V value)
8384
{
8485
Interlocked.Increment(ref sequence);

0 commit comments

Comments
 (0)