Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ThreadPoolTaskScheduler.cs
Go to the documentation of this file.
2
4
6{
8 {
9 ((Task)s).ExecuteEntryUnsafe(null);
10 };
11
13 {
14 _ = base.Id;
15 }
16
17 protected internal override void QueueTask(Task task)
18 {
21 if ((options & TaskCreationOptions.LongRunning) != 0)
22 {
24 thread.IsBackground = true;
25 thread.Name = ".NET Long Running Task";
26 thread.UnsafeStart(task);
27 }
28 else
29 {
31 }
32 }
33
35 {
37 {
38 return false;
39 }
40 try
41 {
42 task.ExecuteEntryUnsafe(null);
43 }
44 finally
45 {
47 {
49 }
50 }
51 return true;
52 }
53
54 protected internal override bool TryDequeue(Task task)
55 {
57 }
58
63
65 {
66 foreach (object tpwItem in tpwItems)
67 {
68 if (tpwItem is Task task)
69 {
70 yield return task;
71 }
72 }
73 }
74
75 internal override void NotifyWorkItemProgress()
76 {
78 }
79}
override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
static readonly ParameterizedThreadStart s_longRunningThreadWork
static IEnumerable< Task > FilterTasksFromWorkItems(IEnumerable< object > tpwItems)
static void NotifyWorkItemProgress()
static IEnumerable< object > GetQueuedWorkItems()
static bool TryPopCustomWorkItem(object workItem)
static void UnsafeQueueUserWorkItemInternal(object callBack, bool preferLocal)
static bool IsThreadStartSupported
Definition Thread.cs:244
delegate void ParameterizedThreadStart(object? obj)