View Issue Details

IDProjectCategoryView StatusLast Update
0003314JEDI VCL00 JVCL Componentspublic2005-11-18 04:03
ReportermarcgeldonAssigned Tojfudickar 
Status resolvedResolutionunable to reproduce 
Product Version3.00 
Target VersionFixed in Version 
Summary0003314: JvThread not working if created in procedure
DescriptionTJvThread do not work, if you create the component manually. Check the additional information. You can find a demo there.

Additional Informationprocedure TForm1.Button1Click(Sender: TObject);
  i: Integer;
  FThread: TJvThread;
    // create thread
    FThread := TJvThread.Create(Self);
    FThread.Exclusive := False;
    FThread.RunOnCreate := False;
    FThread.FreeOnTerminate := True;
    FThread.OnExecute := FThreadExecute;

    for i := 1 to 3 do

    for i := 0 to FThread.Count-1 do

    while not FThread.Count = 0 do

procedure TForm1.FThreadExecute(Sender: TObject; Params: Pointer);
  i: Integer;
  j: Integer;
  // just do something
  for i := 0 to 10000 do
    j := i;
TagsNo tags attached.



2005-11-16 02:20

reporter   ~0008089

the threads don't terminate. If I do the same thing in a Form (I create the non-visible object TJvThread in a form, set the properties and so on) it does work without any problem.

Why do I want to create TJvThread manually? I have a component where it should working on. But it doesn't. Same problem as in this example.


2005-11-16 05:36

reporter   ~0008091

Ok I found the problem. If I put a "Application.ProcessMessages;" in the while loop (while not (FThread.Count = 0) do), it does work.

Also the correct while loop is =
while not (FThread.Count = 0) do

I think we can close this bug

Issue History

Date Modified Username Field Change
2005-11-16 02:12 marcgeldon New Issue
2005-11-16 02:20 marcgeldon Note Added: 0008089
2005-11-16 05:36 marcgeldon Note Added: 0008091
2005-11-18 04:03 jfudickar Status new => resolved
2005-11-18 04:03 jfudickar Resolution open => unable to reproduce
2005-11-18 04:03 jfudickar Assigned To => jfudickar