About passing FrameSet from asynchronous thread to main thread (C #)
I want to pass the FrameSet acquired in the asynchronous thread to the main thread.
I tried the following code, but when the source FrameSet is released, the copy destination is also released.
How can this be achieved?
<code (C#)>
FrameSet fs;
Task.Factory.StartNew(() =>
{
while (!tokenSource.Token.IsCancellationRequested)
{
using (var frames = pipeline.WaitForFrames())
{
fs = frames;
}
}
}, tokenSource.Token);
Please sign in to leave a comment.
Comments
0 comments