-
Notifications
You must be signed in to change notification settings - Fork 277
[AI Task] [Tizen.Multimedia.Remoting] Add RunContinuationsAsynchronously to async TCS #7696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,7 +168,7 @@ public async Task StartAsync() | |
|
|
||
| ValidateWebRTCState(WebRTCState.Idle); | ||
|
|
||
| var tcs = new TaskCompletionSource<bool>(); | ||
| var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that As a result, the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [AI Review] |
||
| var error = WebRTCError.ConnectionFailed; | ||
|
|
||
| EventHandler<WebRTCStateChangedEventArgs> stateChangedEventHandler = (s, e) => | ||
|
|
@@ -244,7 +244,7 @@ public async Task<string> CreateOfferAsync() | |
|
|
||
| ValidateWebRTCState(WebRTCState.Negotiating, WebRTCState.Playing); | ||
|
|
||
| var tcsSdpCreated = new TaskCompletionSource<string>(); | ||
| var tcsSdpCreated = new TaskCompletionSource<string>(TaskCreationOptions.RunContinuationsAsynchronously); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that Therefore, the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [AI Review] |
||
|
|
||
| NativeWebRTC.SdpCreatedCallback cb = (handle, sdp, _) => | ||
| { | ||
|
|
@@ -283,7 +283,7 @@ public async Task<string> CreateAnswerAsync() | |
|
|
||
| ValidateWebRTCState(WebRTCState.Negotiating, WebRTCState.Playing); | ||
|
|
||
| var tcsSdpCreated = new TaskCompletionSource<string>(); | ||
| var tcsSdpCreated = new TaskCompletionSource<string>(TaskCreationOptions.RunContinuationsAsynchronously); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that Therefore, the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [AI Review] |
||
|
|
||
| NativeWebRTC.SdpCreatedCallback cb = (handle, sdp, _) => | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
RunAsyncmethod can be simplified by returning theTaskfromTask.Rundirectly, rather than wrapping it in a redundantTaskCompletionSource<bool>. SinceRunAsyncreturns a non-genericTask, theboolresult is ignored anyway.Refactoring this avoids the allocation of the
TaskCompletionSourceand its associated task, and simplifies error propagation.For example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 [AI Review]
Addressed in 64f1117.