diff --git a/src/Renci.SshNet/Abstractions/ThreadAbstraction.cs b/src/Renci.SshNet/Abstractions/ThreadAbstraction.cs index fe6e3e21..47175030 100644 --- a/src/Renci.SshNet/Abstractions/ThreadAbstraction.cs +++ b/src/Renci.SshNet/Abstractions/ThreadAbstraction.cs @@ -36,9 +36,10 @@ namespace Renci.SshNet.Abstractions /// The action to execute. public static void ExecuteThread(Action action) { +#if FEATURE_THREAD_THREADPOOL if (action == null) throw new ArgumentNullException("action"); -#if FEATURE_THREAD_THREADPOOL + System.Threading.ThreadPool.QueueUserWorkItem(o => action()); #elif FEATURE_THREAD_TAP System.Threading.Tasks.Task.Run(action);