Skip to content

Instantly share code, notes, and snippets.

@PreyK
Created July 26, 2019 13:02
Show Gist options
  • Save PreyK/cd9243a1d1f536f04838fb37d3aacf67 to your computer and use it in GitHub Desktop.
Save PreyK/cd9243a1d1f536f04838fb37d3aacf67 to your computer and use it in GitHub Desktop.
c# uj thread
using System;
using System.Threading;
namespace Threading
{
class Program
{
static void Main(string[] args)
{
//ez indit el egy uj threadet
Thread thr = new Thread(new ThreadStart(SecondThreadWorker));
thr.Start();
}
//ez fog futni az uj threaden
static void SecondThreadWorker()
{
Console.WriteLine("Hello From another thread!");
//innen igy tudod elerni a formot mer nem lehet cross-thread modositani:
//this.Invoke(new Action(() => MetodusAmiUpdateliAzUI-t(parameterek pl. szenzor data)));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment