You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We never cloned the awaitable duck-typing interface of DispatcherOperation in our port of it to Mac. Writing code that awaits a DispatcherOperation will compile, and then crash at runtime when executed on Mac.
Furthermore, a common mechanism of obtaining a DispatcherOperation is from a call to DispatcherUtility.BeginInvokeIfNecessary, which will return null if the invoke is not necessary. This makes would-be usage somewhat a pit of failure.
Instead, either:
Use BeginInvoke(IfNecessary) and ignore the result if fire-and-forget is sufficient.
Use an explicit thread-switching mechanism if an AsyncMethodContext or AsyncActions context is available.
Use Invoke to synchronously execute code on the Dispatcher's context in a cross-platform compatible way.
The text was updated successfully, but these errors were encountered:
We never cloned the awaitable duck-typing interface of
DispatcherOperation
in our port of it to Mac. Writing code thatawait
s aDispatcherOperation
will compile, and then crash at runtime when executed on Mac.Furthermore, a common mechanism of obtaining a
DispatcherOperation
is from a call toDispatcherUtility.BeginInvokeIfNecessary
, which will returnnull
if the invoke is not necessary. This makes would-be usage somewhat a pit of failure.Instead, either:
BeginInvoke(IfNecessary)
and ignore the result if fire-and-forget is sufficient.AsyncMethodContext
orAsyncAction
s context is available.Invoke
to synchronously execute code on theDispatcher
's context in a cross-platform compatible way.The text was updated successfully, but these errors were encountered: