File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed
samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Threading.ThreadStart2/VB Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+
3
+ <PropertyGroup >
4
+ <OutputType >Library</OutputType >
5
+ <TargetFramework >net9.0</TargetFramework >
6
+ </PropertyGroup >
7
+
8
+ </Project >
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ Public class Simple
42
42
+ "starting the new InstanceCaller thread." )
43
43
44
44
' Create the thread object, passing in the
45
- ' serverObject .SharedMethod method using a
45
+ ' ServerClass .SharedMethod method using a
46
46
' ThreadStart delegate.
47
47
Dim SharedCaller As New Thread( _
48
48
New ThreadStart( AddressOf ServerClass.SharedMethod))
@@ -56,9 +56,9 @@ Public class Simple
56
56
End Class
57
57
' The example displays output like the following:
58
58
' The Main() thread calls this after starting the new InstanceCaller thread.
59
- ' The Main() thread calls this after starting the new StaticCaller thread.
60
- ' ServerClass.StaticMethod is running on another thread.
59
+ ' The Main() thread calls this after starting the new SharedCaller thread.
60
+ ' ServerClass.SharedMethod is running on another thread.
61
61
' ServerClass.InstanceMethod is running on another thread.
62
62
' The instance method called by the worker thread has ended.
63
- ' The static method called by the worker thread has ended.
63
+ ' The shared method called by the worker thread has ended.
64
64
'</snippet2>
Original file line number Diff line number Diff line change 1
1
'<snippet4>
2
2
Imports System.Threading
3
3
4
- ' The ThreadWithState class contains the information needed for
4
+ ' The ThreadWithState2 class contains the information needed for
5
5
' a task, the method that executes the task, and a delegate
6
6
' to call when the task is complete.
7
- Public Class ThreadWithState
7
+ Public Class ThreadWithState2
8
8
' State information used in the task.
9
9
Private boilerplate As String
10
10
Private numberValue As Integer
@@ -34,13 +34,12 @@ Public Class ThreadWithState
34
34
End Class
35
35
36
36
' Delegate that defines the signature for the callback method.
37
- '
38
37
Public Delegate Sub ExampleCallback(lineCount As Integer )
39
38
40
- Public Class Example
39
+ Public Class Example2
41
40
Public Shared Sub Main()
42
41
' Supply the state information required by the task.
43
- Dim tws As New ThreadWithState ( _
42
+ Dim tws As New ThreadWithState2 ( _
44
43
"This report displays the number {0}." , _
45
44
42 , _
46
45
AddressOf ResultCallback)
You can’t perform that action at this time.
0 commit comments