-1
這裏是我的代碼這是一條線程不安全的呼叫嗎?
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是一個公共布爾變量指定何時到店的線程。
如果我從StartPrinting
和frmEmail
從SendEmails
訪問任何控制frmPrint
,它會是線程不安全的調用? StartPrinting
是frmPrint
公共Sub和SendEmails
是frmEmail