这是我的代码
Public th As New Thread(New ThreadStart(AddressOf StartFirstPrint))
Public th4 As New Thread(New ThreadStart(AddressOf sendFirstEmail))
这是和的StartFirstPrint
代码sendFirstEmail
Public Sub StartFirstPrint()
Do While thCont
Try
Dim frm As New frmPrint()
'frm.MdiParent = Me
frm.StartPrinting()
Catch ex As Exception
End Try
Loop
End Sub
Public Sub sendFirstEmail()
Do While thCont
Try
Dim frmSNDEmail As New frmEmail
frmSNDEmail.SendEmails()
Catch ex As Exception
End Try
Loop
End Sub
thCont是一个公共布尔变量,它指定何时购买这些线程。
如果我访问 from 的任何控件和frmPrint
from的StartPrinting
任何控件frmEmail
,SendEmails
它会是线程不安全调用吗?
StartPrinting
是的公共子,frmPrint
并且SendEmails
是的公共子frmEmail