|
OpenCV for Unity 3.0.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/5.0/index.html ) for the details of the argument of the method.
|
Temporarily restores a captured SynchronizationContext for the current async flow. More...
Public Member Functions | |
| SourceToMatSynchronizationContextScope (SynchronizationContext captured) | |
| Initializes a new instance of the SourceToMatSynchronizationContextScope struct. | |
| void | Dispose () |
| Restores SynchronizationContext.Current to the value from before this scope was created. | |
Temporarily restores a captured SynchronizationContext for the current async flow.
Layer 2 (host loop). Wrap the full host-loop-dependent body of grabber Grabbers.IFrameGrabber.OpenAsync in this scope. Use SourceToMatHostMarshaling.ResolveCapturedSynchronizationContext for the captured argument.
Host-loop ticks via SourceToMatHostWait or SourceToMatHostMarshaling.YieldCapturedSynchronizationContextAsync run inside this scope (or a nested scope when an inner await may clear SynchronizationContext.Current).
When captured is null, the scope is a no-op (nothing is saved or restored). Prefer constructing grabbers on the host main thread so a non-null context is captured.
Always dispose (for example using) so SynchronizationContext.Current is restored. Nesting is supported: each scope saves and restores its own previous context.
| OpenCVForUnity.Extensions.SourceToMat.SourceToMatSynchronizationContextScope.SourceToMatSynchronizationContextScope | ( | SynchronizationContext | captured | ) |
Initializes a new instance of the SourceToMatSynchronizationContextScope struct.
| captured | Synchronization context captured on the main thread; null makes the scope a no-op. |
| void OpenCVForUnity.Extensions.SourceToMat.SourceToMatSynchronizationContextScope.Dispose | ( | ) |
Restores SynchronizationContext.Current to the value from before this scope was created.