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
4242 + "starting the new InstanceCaller thread." )
4343
4444 ' Create the thread object, passing in the
45- ' serverObject .SharedMethod method using a
45+ ' ServerClass .SharedMethod method using a
4646 ' ThreadStart delegate.
4747 Dim SharedCaller As New Thread( _
4848 New ThreadStart( AddressOf ServerClass.SharedMethod))
@@ -56,9 +56,9 @@ Public class Simple
5656End Class
5757' The example displays output like the following:
5858' 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.
6161' ServerClass.InstanceMethod is running on another thread.
6262' 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.
6464'</snippet2>
Original file line number Diff line number Diff line change 11'<snippet4>
22Imports System.Threading
33
4- ' The ThreadWithState class contains the information needed for
4+ ' The ThreadWithState2 class contains the information needed for
55' a task, the method that executes the task, and a delegate
66' to call when the task is complete.
7- Public Class ThreadWithState
7+ Public Class ThreadWithState2
88 ' State information used in the task.
99 Private boilerplate As String
1010 Private numberValue As Integer
@@ -34,13 +34,12 @@ Public Class ThreadWithState
3434End Class
3535
3636' Delegate that defines the signature for the callback method.
37- '
3837Public Delegate Sub ExampleCallback(lineCount As Integer )
3938
40- Public Class Example
39+ Public Class Example2
4140 Public Shared Sub Main()
4241 ' Supply the state information required by the task.
43- Dim tws As New ThreadWithState ( _
42+ Dim tws As New ThreadWithState2 ( _
4443 "This report displays the number {0}." , _
4544 42 , _
4645 AddressOf ResultCallback)
You can’t perform that action at this time.
0 commit comments