private void JobFinished(AsyncResult <IOutput> jar, IOutput outp) { try { FreeStreamId(jar.StreamId); } finally { jar.SetResult(outp); jar.Complete(); (outp as IWaitableForDispose).WaitForDispose(); } }
private void JobFinished(int streamId, IOutput outp) { AsyncResult <IOutput> ar = null; try { lock (_frameGuardier) { ar = _frameReadAsyncResult[streamId]; _frameReadAsyncResult[streamId] = null; FreeStreamId(streamId); } } finally { if (ar != null) { ar.SetResult(outp); ar.Complete(); (outp as IWaitableForDispose).WaitForDispose(); } } }