Skip to content

Commit fde80fc

Browse files
ericmuttaRon Petrusha
authored andcommitted
Update Monitor.xml (#2642)
Move bracketed comment `(to be moved, the thread must be at the head of the waiting queue)` towards the end of the sentence so it doesn't interrupt the reading flow when the sentence refers to the `Pulse` and `PulseAll` methods. I have also clarified that the thread in question is the one that called the `Wait` method, which helps explain why it would be in the waiting queue and would later be moved to the ready queue when `Pulse` or `PulseAll` are called.
1 parent c7324df commit fde80fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xml/System.Threading/Monitor.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
## Pulse, PulseAll, and Wait
129129
Once a thread owns the lock and has entered the critical section that the lock protects, it can call the <xref:System.Threading.Monitor.Wait%2A?displayProperty=nameWithType>, <xref:System.Threading.Monitor.Pulse%2A?displayProperty=nameWithType>, and <xref:System.Threading.Monitor.PulseAll%2A?displayProperty=nameWithType> methods.
130130
131-
When the thread that holds the lock calls <xref:System.Threading.Monitor.Wait%2A>, the lock is released and the thread is added to the waiting queue of the synchronized object. The first thread in the ready queue, if any, acquires the lock and enters the critical section. The thread is moved from the waiting queue to the ready queue when either the <xref:System.Threading.Monitor.Pulse%2A?displayProperty=nameWithType> (to be moved, the thread must be at the head of the waiting queue) or the <xref:System.Threading.Monitor.PulseAll%2A?displayProperty=nameWithType> method is called by the thread that holds the lock. The <xref:System.Threading.Monitor.Wait%2A> method returns when the calling thread reacquires the lock.
131+
When the thread that holds the lock calls <xref:System.Threading.Monitor.Wait%2A>, the lock is released and the thread is added to the waiting queue of the synchronized object. The first thread in the ready queue, if any, acquires the lock and enters the critical section. The thread that called <xref:System.Threading.Monitor.Wait%2A> is moved from the waiting queue to the ready queue when either the <xref:System.Threading.Monitor.Pulse%2A?displayProperty=nameWithType> or the <xref:System.Threading.Monitor.PulseAll%2A?displayProperty=nameWithType> method is called by the thread that holds the lock (to be moved, the thread must be at the head of the waiting queue). The <xref:System.Threading.Monitor.Wait%2A> method returns when the calling thread reacquires the lock.
132132
133133
When the thread that holds the lock calls <xref:System.Threading.Monitor.Pulse%2A>, the thread at the head of the waiting queue is moved to the ready queue. The call to the <xref:System.Threading.Monitor.PulseAll%2A> method moves all the threads from the waiting queue to the ready queue.
134134
@@ -1456,4 +1456,4 @@
14561456
</Docs>
14571457
</Member>
14581458
</Members>
1459-
</Type>
1459+
</Type>

0 commit comments

Comments
 (0)