2 using System
.Threading
;
6 static ManualResetEvent mre
= new ManualResetEvent (false);
10 public int I { get; set; }
15 Console
.WriteLine($"Finalizer {I}");
16 } catch (NotSupportedException
) {
23 public static void Main(string[] args
)
25 for (int i
= 0; i
< 50; ++i
) {
31 GC
.WaitForPendingFinalizers();
32 Console
.WriteLine($"Loop {i}");
39 static void SpawnThread(int i
)
41 var th
= new Thread(_
=> {}) { IsBackground = true, }
;
42 th
.Start(new MyClassInThread { I = i }
);