| View previous topic :: View next topic |
| Author |
Message |
guan_2000 Member
Joined: 16 Sep 2006 Posts: 3
|
Posted: 16/09/06 06:00 Post subject: Why the software deadlock?(tpicshow) |
|
|
I use the control tpicshow now. Version : 4.03 .The software will deadlock in the individual computer when "threaded" is true.
Particularly new computer .I have more than 800 customers
in the use of software products . More than 30 users Software will deadlock.If i Set up parameters of "threaded" false, The software would not deadlock.
All the computer of deadlock happened is purchased recently .
Who can help me?
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1044 Location: Tehran, Iran
|
Posted: 16/09/06 13:53 Post subject: |
|
|
You have to re-check your code of the control's event handlers. Probably they are not thread-safe.
_________________ Kambiz |
|
| Back to top |
|
 |
guan_2000 Member
Joined: 16 Sep 2006 Posts: 3
|
Posted: 16/09/06 16:25 Post subject: |
|
|
thank you very much!
I have no writed code of the control's event handlers.
I writed a control nameed TMCtrlPicText, the control Contains tpicshow.
my part of code:
| Code: | type
TMCtrlPicText = class(TPanel)
private
{ Private declarations }
FFlash: TShockwaveFlash; //in deadlock testing ,assign the nill
FRxGif: TRxGIFAnimator; //in deadlock testing ,assign the nill
FPicShow: TPicShow;
FMovie: TActiveMovie; //in deadlock testing ,assign the nill
...
...
procedure TMCtrlPicText.Open(aContainer: TElementContainer; wait: boolean; timeset: integer);
begin
...
FPicShow := TPicShow.Create(self);
FPicShow.Parent := self;
FPicShow.Width := Width;
FPicShow.Height := Height;
FPicShow.Left := 0;
FPicShow.Top := 0;
FPicShow.Visible := false;
...
end;
destructor TMCtrlPicText.Destroy;
begin
...
FPicShow.Free;
inherited;
...
end;
procedure TMCtrlPicText.Play;
begin
...
FPicShow.Picture.Assign(TMPicText(FContainer.ElementList.Objects[FCurBusyElement]).GetBitmap);
Randomize;
FPicShow.Style := Random(170);
FPicShow.Execute;
Invalidate;
SetTimer(Handle,1,50,nil);
...
end;
procedure TMCtrlPicText.TimerTick(var Msg: TMessage);
begin
...
if FPicShow.Busy then
...
//check the control whether the 'busy' is false.If the 'busy' is false,my control is 'free'.
end; |
the master code creat my control on-line ,waiting...,free,
Next the master line creat the control on-line again,assign another the value,plots the above process.
//Mod - Added code tags[/code]
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1044 Location: Tehran, Iran
|
Posted: 17/09/06 13:52 Post subject: |
|
|
Instead of checking PicShow's status using a timer, try to use OnStop event of the control. When OnStop event is raised, start a timer to release your object after a short delay.
Also, after executing PicShow, you do not need to call Invalidate.
_________________ Kambiz |
|
| Back to top |
|
 |
guan_2000 Member
Joined: 16 Sep 2006 Posts: 3
|
Posted: 20/09/06 06:13 Post subject: |
|
|
| In fact,after i check the control's 'busy' is false,the timer delay 5 seconds for picture display, then,my control is 'free'.
|
|
| Back to top |
|
 |
|