File tree 1 file changed +0
-17
lines changed
src/Renci.SshNet/Abstractions 1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -10,28 +10,17 @@ internal static class ThreadAbstraction
10
10
/// <param name="millisecondsTimeout">The number of milliseconds for which the thread is suspended.</param>
11
11
public static void Sleep ( int millisecondsTimeout )
12
12
{
13
- #if FEATURE_THREAD_SLEEP
14
13
System . Threading . Thread . Sleep ( millisecondsTimeout ) ;
15
- #elif FEATURE_THREAD_TAP
16
- System . Threading . Tasks . Task . Delay ( millisecondsTimeout ) . GetAwaiter ( ) . GetResult ( ) ;
17
- #else
18
- #error Suspend of the current thread is not implemented.
19
- #endif
20
14
}
21
15
22
16
public static void ExecuteThreadLongRunning ( Action action )
23
17
{
24
18
if ( action == null )
25
19
throw new ArgumentNullException ( "action" ) ;
26
- #if FEATURE_THREAD_TAP
27
- var taskCreationOptions = System . Threading . Tasks . TaskCreationOptions . LongRunning ;
28
- System . Threading . Tasks . Task . Factory . StartNew ( action , taskCreationOptions ) ;
29
- #else
30
20
new System . Threading . Thread ( ( ) => action ( ) )
31
21
{
32
22
IsBackground = true
33
23
} . Start ( ) ;
34
- #endif
35
24
}
36
25
37
26
/// <summary>
@@ -40,16 +29,10 @@ public static void ExecuteThreadLongRunning(Action action)
40
29
/// <param name="action">The action to execute.</param>
41
30
public static void ExecuteThread ( Action action )
42
31
{
43
- #if FEATURE_THREAD_THREADPOOL
44
32
if ( action == null )
45
33
throw new ArgumentNullException ( "action" ) ;
46
34
47
35
System . Threading . ThreadPool . QueueUserWorkItem ( o => action ( ) ) ;
48
- #elif FEATURE_THREAD_TAP
49
- System . Threading . Tasks . Task . Run ( action ) ;
50
- #else
51
- #error Execution of action in a separate thread is not implemented.
52
- #endif
53
36
}
54
37
}
55
38
}
You can’t perform that action at this time.
0 commit comments