You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xml/System.Threading/ManualResetEvent.xml
+20-19Lines changed: 20 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -34,28 +34,29 @@
34
34
</Attribute>
35
35
</Attributes>
36
36
<Docs>
37
-
<summary>Notifies one or more waiting threads that an event has occurred. This class cannot be inherited.</summary>
37
+
<summary>Represents a thread synchronization event that, when signaled, must be reset manually. This class cannot be inherited.</summary>
38
38
<remarks>
39
39
<formattype="text/markdown"><![CDATA[
40
40
41
41
## Remarks
42
-
In the .NET Framework version 2.0, <xref:System.Threading.ManualResetEvent> derives from the new <xref:System.Threading.EventWaitHandle> class. A <xref:System.Threading.ManualResetEvent> is functionally equivalent to an <xref:System.Threading.EventWaitHandle> created with <xref:System.Threading.EventResetMode.ManualReset?displayProperty=nameWithType>.
43
-
44
-
> [!NOTE]
45
-
> Unlike the <xref:System.Threading.ManualResetEvent> class, the <xref:System.Threading.EventWaitHandle> class provides access to named system synchronization events.
46
-
47
-
<xref:System.Threading.ManualResetEvent> allows threads to communicate with each other by signaling. Typically, this communication concerns a task which one thread must complete before other threads can proceed.
48
-
49
-
When a thread begins an activity that must complete before other threads proceed, it calls <xref:System.Threading.EventWaitHandle.Reset%2A> to put `ManualResetEvent` in the non-signaled state. This thread can be thought of as controlling the `ManualResetEvent`. Threads that call <xref:System.Threading.WaitHandle.WaitOne%2A> on the `ManualResetEvent` will block, awaiting the signal. When the controlling thread completes the activity, it calls <xref:System.Threading.EventWaitHandle.Set%2A> to signal that the waiting threads can proceed. All waiting threads are released.
50
-
51
-
Once it has been signaled, `ManualResetEvent` remains signaled until it is manually reset. That is, calls to `WaitOne` return immediately.
52
-
53
-
You can control the initial state of a `ManualResetEvent` by passing a Boolean value to the constructor, `true` if the initial state is signaled and `false` otherwise.
54
-
55
-
`ManualResetEvent` can also be used with the `static`<xref:System.Threading.WaitHandle.WaitAll%2A> and <xref:System.Threading.WaitHandle.WaitAny%2A> methods.
42
+
43
+
You use `ManualResetEvent`, <xref:System.Threading.AutoResetEvent>, and <xref:System.Threading.EventWaitHandle> for thread interaction (or thread signaling). For more information, see the [Thread interaction, or signaling](~/docs/standard/threading/overview-of-synchronization-primitives.md#thread-interaction-or-signaling) section of the [Overview of synchronization primitives](~/docs/standard/threading/overview-of-synchronization-primitives.md) article.
44
+
45
+
When a thread begins an activity that must complete before other threads proceed, it calls [ManualResetEvent.Reset](xref:System.Threading.EventWaitHandle.Reset%2A) to put `ManualResetEvent` in the non-signaled state. This thread can be thought of as controlling the `ManualResetEvent`. Threads that call [ManualResetEvent.WaitOne](xref:System.Threading.WaitHandle.WaitOne%2A) block, awaiting the signal. When the controlling thread completes the activity, it calls [ManualResetEvent.Set](xref:System.Threading.EventWaitHandle.Set%2A) to signal that the waiting threads can proceed. All waiting threads are released.
46
+
47
+
Once it has been signaled, `ManualResetEvent` remains signaled until it is manually reset by calling the <xref:System.Threading.EventWaitHandle.Reset> method. That is, calls to <xref:System.Threading.WaitHandle.WaitOne%2A> return immediately.
48
+
49
+
You can control the initial state of a `ManualResetEvent` by passing a Boolean value to the constructor: `true` if the initial state is signaled, and `false` otherwise.
50
+
51
+
`ManualResetEvent` can also be used with the `static` <xref:System.Threading.WaitHandle.WaitAll%2A> and <xref:System.Threading.WaitHandle.WaitAny%2A> methods.
56
52
57
-
For more information about thread synchronization mechanisms, see [ManualResetEvent and ManualResetEventSlim](~/docs/standard/threading/manualresetevent-and-manualreseteventslim.md) in the conceptual documentation.
53
+
Beginning with the .NET Framework version 2.0, <xref:System.Threading.ManualResetEvent> derives from the <xref:System.Threading.EventWaitHandle> class. A <xref:System.Threading.ManualResetEvent> is functionally equivalent to an <xref:System.Threading.EventWaitHandle> created with <xref:System.Threading.EventResetMode.ManualReset?displayProperty=nameWithType>.
58
54
55
+
> [!NOTE]
56
+
> Unlike the <xref:System.Threading.ManualResetEvent> class, the <xref:System.Threading.EventWaitHandle> class provides access to named system synchronization events.
57
+
58
+
Beginning with the .NET Framework version 4.0, the <xref:System.Threading.ManualResetEventSlim?displayProperty=nameWithType> class is a lightweight alternative to <xref:System.Threading.ManualResetEvent>.
59
+
59
60
60
61
61
62
## Examples
@@ -74,7 +75,7 @@
74
75
<threadsafe>This class is thread safe.</threadsafe>
0 commit comments