Results 1 to 2 of 2

Thread: Thread.join problem

  1. #1

    Thread Starter
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    Thread.join problem

    Hi

    VB Code:
    1. If iLottNo(0) > 0 Then
    2.                     Dim Thread0 As New System.Threading.Thread(AddressOf clsIssueTickets.IssueSeries0)
    3.                     Thread0.Start()
    4.                     If Thread0.Join(4000) Then 'Set time out of thread
    5.                         iStart(0) = clsIssueTickets.iReturnStartNo(0)
    6.                         iEnd(0) = clsIssueTickets.iReturnEndNo(0)
    7.                         If iStart(0) > 0 Then
    8.                             Dim iCtr0 As Integer
    9.                             For iCtr0 = iStart(0) To iEnd(0) Step 100
    10.                                 sOutput = sOutput & iCtr0 & "-09 "
    11.                             Next
    12.                         End If
    13.                     End If
    14.                 End If

    code after Thread0.Join(4000) does not executes. why?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Thread0.Join(4000) only returns True, which cause the rest of the code to execute, IF clsIssueTickets.IssueSeries0 is finished executing within the designated 4000 milliseconds. So it sounds like clsIssueTickets.IssueSeries0 is taking longer than that to finish executing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width