Provides the basic functionality for propagating a synchronization context in various synchronization models.
More...
|
void | SetWaitNotificationRequired () |
| Sets notification that wait notification is required and prepares the callback method so it can be called more reliably when a wait occurs. More...
|
|
static int | WaitHelper (IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) |
| Helper function that waits for any or all the elements in the specified array to receive a signal. More...
|
|
Provides the basic functionality for propagating a synchronization context in various synchronization models.
Definition at line 12 of file SynchronizationContext.cs.
◆ SynchronizationContext()
System.Threading.SynchronizationContext.SynchronizationContext |
( |
| ) |
|
Creates a new instance of the T:System.Threading.SynchronizationContext class.
Definition at line 54 of file SynchronizationContext.cs.
◆ CreateCopy()
When overridden in a derived class, creates a copy of the synchronization context.
- Returns
- A new T:System.Threading.SynchronizationContext object.
Definition at line 219 of file SynchronizationContext.cs.
◆ IsWaitNotificationRequired()
bool System.Threading.SynchronizationContext.IsWaitNotificationRequired |
( |
| ) |
|
Determines if wait notification is required.
- Returns
true
if wait notification is required; otherwise, false
.
Definition at line 93 of file SynchronizationContext.cs.
◆ OperationCompleted()
virtual void System.Threading.SynchronizationContext.OperationCompleted |
( |
| ) |
|
|
virtual |
When overridden in a derived class, responds to the notification that an operation has completed.
Definition at line 125 of file SynchronizationContext.cs.
◆ OperationStarted()
virtual void System.Threading.SynchronizationContext.OperationStarted |
( |
| ) |
|
|
virtual |
When overridden in a derived class, responds to the notification that an operation has started.
Definition at line 119 of file SynchronizationContext.cs.
◆ Post()
virtual void System.Threading.SynchronizationContext.Post |
( |
SendOrPostCallback |
d, |
|
|
object |
state |
|
) |
| |
|
virtual |
When overridden in a derived class, dispatches an asynchronous message to a synchronization context.
- Parameters
-
d | The T:System.Threading.SendOrPostCallback delegate to call. |
state | The object passed to the delegate. |
Definition at line 112 of file SynchronizationContext.cs.
◆ Send()
virtual void System.Threading.SynchronizationContext.Send |
( |
SendOrPostCallback |
d, |
|
|
object |
state |
|
) |
| |
|
virtual |
When overridden in a derived class, dispatches a synchronous message to a synchronization context.
- Parameters
-
d | The T:System.Threading.SendOrPostCallback delegate to call. |
state | The object passed to the delegate. |
- Exceptions
-
T:System.NotSupportedException | The method was called in a Windows Store app. The implementation of T:System.Threading.SynchronizationContext for Windows Store apps does not support the M:System.Threading.SynchronizationContext.Send(System.Threading.SendOrPostCallback,System.Object) method. |
Definition at line 103 of file SynchronizationContext.cs.
◆ SetSynchronizationContext()
static void System.Threading.SynchronizationContext.SetSynchronizationContext |
( |
SynchronizationContext |
syncContext | ) |
|
|
static |
Sets the current synchronization context.
- Parameters
-
syncContext | The T:System.Threading.SynchronizationContext object to be set. |
Definition at line 166 of file SynchronizationContext.cs.
◆ SetWaitNotificationRequired()
void System.Threading.SynchronizationContext.SetWaitNotificationRequired |
( |
| ) |
|
|
protected |
Sets notification that wait notification is required and prepares the callback method so it can be called more reliably when a wait occurs.
Definition at line 60 of file SynchronizationContext.cs.
◆ Wait()
virtual int System.Threading.SynchronizationContext.Wait |
( |
IntPtr [] |
waitHandles, |
|
|
bool |
waitAll, |
|
|
int |
millisecondsTimeout |
|
) |
| |
|
virtual |
Waits for any or all the elements in the specified array to receive a signal.
- Parameters
-
waitHandles | An array of type T:System.IntPtr that contains the native operating system handles. |
waitAll | true to wait for all handles; false to wait for any handle. |
millisecondsTimeout | The number of milliseconds to wait, or F:System.Threading.Timeout.Infinite (-1) to wait indefinitely. |
- Returns
- The array index of the object that satisfied the wait.
- Exceptions
-
T:System.ArgumentNullException | waitHandles is null. |
Definition at line 140 of file SynchronizationContext.cs.
◆ WaitHelper()
static int System.Threading.SynchronizationContext.WaitHelper |
( |
IntPtr [] |
waitHandles, |
|
|
bool |
waitAll, |
|
|
int |
millisecondsTimeout |
|
) |
| |
|
protected |
Helper function that waits for any or all the elements in the specified array to receive a signal.
- Parameters
-
waitHandles | An array of type T:System.IntPtr that contains the native operating system handles. |
waitAll | true to wait for all handles; false to wait for any handle. |
millisecondsTimeout | The number of milliseconds to wait, or F:System.Threading.Timeout.Infinite (-1) to wait indefinitely. |
- Returns
- The array index of the object that satisfied the wait.
◆ Current
Gets the synchronization context for the current thread.
- Returns
- A T:System.Threading.SynchronizationContext object representing the current synchronization context.
Definition at line 35 of file SynchronizationContext.cs.
The documentation for this class was generated from the following file: