public Default_EventLoop() { _FuncDeclare_To_Keep_GC_From_Collecting = virEventTimeoutCallback; _FuncDeclare_To_Keep_GC_From_Collecting_free = DummyFree; Libvirt.API.virEventRegisterDefaultImpl(); TimerHandle = Libvirt.API.virEventAddTimeout(1000, _FuncDeclare_To_Keep_GC_From_Collecting, IntPtr.Zero, _FuncDeclare_To_Keep_GC_From_Collecting_free); if (TimerHandle < 0) { Debug.WriteLine("Could not register callback for event loop. This will lead to instability within the program."); } }
public Libvirt_EventLoop() { _FuncDeclare_To_Keep_GC_From_Collecting = virEventTimeoutCallback; _FuncDeclare_To_Keep_GC_From_Collecting_free = DummyFree; Libvirt.API.virEventRegisterDefaultImpl(); TimerHandle = Libvirt.API.virEventAddTimeout(1000, _FuncDeclare_To_Keep_GC_From_Collecting, IntPtr.Zero, _FuncDeclare_To_Keep_GC_From_Collecting_free); if (TimerHandle < 0) { System.Windows.Forms.MessageBox.Show("Could not register callback for event loop. This will lead to instability within the program."); } else { _EventLoop = new System.Threading.Thread(EventLoop); _EventLoop.Start(); } }