@@ -55,12 +55,12 @@ public class ReaderWriterLockSlim : IDisposable
55
55
//Specifying if locked can be reacquired recursively.
56
56
private bool _fIsReentrant ;
57
57
58
- // Lock specifiation for myLock: This lock protects exactly the local fields associted
59
- // instance of ReaderWriterLockSlim. It does NOT protect the memory associted with the
58
+ // Lock specification for myLock: This lock protects exactly the local fields associated with this
59
+ // instance of ReaderWriterLockSlim. It does NOT protect the memory associated with
60
60
// the events that hang off this lock (eg writeEvent, readEvent upgradeEvent).
61
61
private int _myLock ;
62
62
63
- //The variables controlling spinning behaviior of Mylock(which is a spin-lock)
63
+ //The variables controlling spinning behavior of Mylock(which is a spin-lock)
64
64
65
65
private const int LockSpinCycles = 20 ;
66
66
private const int LockSpinCount = 10 ;
@@ -105,19 +105,19 @@ public class ReaderWriterLockSlim : IDisposable
105
105
//Note:
106
106
//The Uint is divided as follows:
107
107
//
108
- //Writer-Owned Waiting-Writers Waiting Upgraders Num-REaders
108
+ //Writer-Owned Waiting-Writers Waiting Upgraders Num-Readers
109
109
// 31 30 29 28.......0
110
110
//
111
111
//Dividing the uint, allows to vastly simplify logic for checking if a
112
- //reader should go in etc. Setting the writer bit, will automatically
112
+ //reader should go in etc. Setting the writer bit will automatically
113
113
//make the value of the uint much larger than the max num of readers
114
114
//allowed, thus causing the check for max_readers to fail.
115
115
116
116
private const uint WRITER_HELD = 0x80000000 ;
117
117
private const uint WAITING_WRITERS = 0x40000000 ;
118
118
private const uint WAITING_UPGRADER = 0x20000000 ;
119
119
120
- //The max readers is actually one less then it's theoretical max.
120
+ //The max readers is actually one less then its theoretical max.
121
121
//This is done in order to prevent reader count overflows. If the reader
122
122
//count reaches max, other readers will wait.
123
123
private const uint MAX_READER = 0x10000000 - 2 ;
@@ -301,7 +301,7 @@ private bool TryEnterReadLockCore(TimeoutTracker timeout)
301
301
//Check if the reader lock is already acquired. Note, we could
302
302
//check the presence of a reader by not allocating rwc (But that
303
303
//would lead to two lookups in the common case. It's better to keep
304
- //a count in the struucture ).
304
+ //a count in the structure ).
305
305
if ( lrwc . readercount > 0 )
306
306
{
307
307
ExitMyLock ( ) ;
@@ -919,7 +919,7 @@ private bool WaitOnEvent(EventWaitHandle waitEvent, ref uint numWaiters, Timeout
919
919
if ( _numWriteUpgradeWaiters == 0 )
920
920
ClearUpgraderWaiting ( ) ;
921
921
922
- if ( ! waitSuccessful ) // We may also be aboutto throw for some reason. Exit myLock.
922
+ if ( ! waitSuccessful ) // We may also be about to throw for some reason. Exit myLock.
923
923
ExitMyLock ( ) ;
924
924
}
925
925
return waitSuccessful ;
0 commit comments