Launching c# Thread in PCL

Hi, I'm playing with xamarin (and it absolutely ROCKS) but I can't start a new thread using "the old" way.

    public void Run()
    {
        Thread thread = new Thread(ThreadMethod);
        thread.Start();
    }

    public void ThreadMethod()
    {
        Debug.WriteLine("Hello from thread");
    }

If I try and do something like the above I'm told Thread doesn't have a constructor that takes 1 parameter.

Am I missing something here? Any help appreciated.

Cheers,

NN.

Posts

  • GrigoryPerepechkoGrigoryPerepechko USMember ✭✭

    AFAIK, Thread class is considered as "non-cross-platform" by MSFT, and they recommend to use Task with LongRunning option in PCL code.

  • newbynewbnewbynewb GBMember

    Ah, cheers man, thanks a lot.

Sign In or Register to comment.