Search code examples
c#macos.net-core.net-mac

Thread.Sleep() in .NET Core on Mac


I'm working with .NET Core on my Mac machine.

Somewhere in my code I want to use this code:

System.Threading.Thread.Sleep(100);

But it can not find Thread in System.Threading namespace.

What's wrong? Isn't Thread available for Mac, or I'm missing something?


Solution

  • Isn't Thread available for Mac?

    Not yet: https://github.com/dotnet/corefx/issues/2576

    The current System.Threading.Thread (and System.Threading.ThreadPool) packages only support desktop and CoreCLR.

    and: https://github.com/dotnet/corefx/issues/2576#issuecomment-187184341

    I can see that the latest System.Threading.Thread package in the dotnet-core NuGet feed hasn't changed this picture.