View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003314 | JEDI VCL | 00 JVCL Components | public | 2005-11-16 02:12 | 2005-11-18 04:03 |
Reporter | marcgeldon | Assigned To | jfudickar | ||
Priority | normal | Severity | block | Reproducibility | always |
Status | resolved | Resolution | unable to reproduce | ||
Product Version | 3.00 | ||||
Target Version | Fixed in Version | ||||
Summary | 0003314: JvThread not working if created in procedure | ||||
Description | TJvThread do not work, if you create the component manually. Check the additional information. You can find a demo there. | ||||
Additional Information | procedure TForm1.Button1Click(Sender: TObject); var i: Integer; FThread: TJvThread; begin try // create thread FThread := TJvThread.Create(Self); FThread.Exclusive := False; FThread.RunOnCreate := False; FThread.FreeOnTerminate := True; FThread.OnExecute := FThreadExecute; for i := 1 to 3 do begin FThread.Execute(Self); end; for i := 0 to FThread.Count-1 do begin FThread.Threads[i].resume; end; while not FThread.Count = 0 do begin Sleep(100); end; finally FreeAndNil(FThread); end; end; procedure TForm1.FThreadExecute(Sender: TObject; Params: Pointer); var i: Integer; j: Integer; begin // just do something for i := 0 to 10000 do begin j := i; end; end; | ||||
Tags | No tags attached. | ||||
|
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. |
|
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 |
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 |