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
Copy file name to clipboardExpand all lines: CefSharp/Internals/CefThread.cs
+53Lines changed: 53 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,58 @@ public static Task<TResult> ExecuteOnUiThread<TResult>(Func<TResult> function)
100
100
}
101
101
}
102
102
103
+
/// <summary>
104
+
/// Execute the provided action on the CEF UI Thread
105
+
/// </summary>
106
+
/// <param name="action">action</param>
107
+
/// <returns>Task</returns>
108
+
publicstaticTaskExecuteOnUiThread(Actionaction)
109
+
{
110
+
lock(LockObj)
111
+
{
112
+
if(HasShutdown)
113
+
{
114
+
thrownewException("Cef.Shutdown has already been called, it's no longer possible to execute on the CEF UI Thread. Check CefThread.HasShutdown to guard against this execption");
115
+
}
116
+
117
+
vartaskFactory=UiThreadTaskFactory;
118
+
119
+
if(taskFactory==null)
120
+
{
121
+
//We don't have a task factory yet, so we'll queue for execution.
0 commit comments