Ejemplo n.º 1
0
        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 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.");
            }
        }
Ejemplo n.º 3
0
 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();
     }
 }