View Issue Details

IDProjectCategoryView StatusLast Update
0006642JEDI VCL00 JVCL Componentspublic2019-04-30 15:15
ReporterswrightAssigned Toobones 
PrioritynormalSeveritycrashReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in VersionDaily / GIT 
Summary0006642: JvWaitingGradient/JvImagedrawThread deadlock condition
DescriptionExecute method calls EnterUnpausableSection

Execute method then calls Synchronize(Draw); which pauses the thread to execute the draw method in main thread.

In the main thread an event occurs that changes the Active property of the JvWaitingGradient to False before the draw event, this makes the main thread Acquire FPauseSection and both threads are deadlocked.

Possibly the Syncronise call should come after the thread releases FPauseSection.
Additional InformationDelphi 10.1 Berlin / JVCL-3.51 APR 2018 (installed via GetIt package manager)
TagsNo tags attached.

Activities

obones

2018-07-18 16:05

administrator   ~0021548

Could you check if the issue is still present in the latest GIT content? If yes, please provide the zipped sources of an application showing this.

2018-07-18 17:38

 

WGTest.zip (5,340 bytes)

swright

2018-07-18 17:39

reporter   ~0021555

fix, move Synchronize(Draw); outside of TCriticalSection.

procedure TJvImageDrawThread.Execute;
begin
  NameThread(ThreadName);
  try
    while not Terminated do
    begin
      Sleep(FDelay);
      EnterUnpauseableSection;
      try
        if Terminated then
          Exit;


      finally
        LeaveUnpauseableSection;
        Synchronize(Draw);
      end;
    end;
  except
    // ignore exception
  end;
end;

mh

2019-04-26 20:26

reporter   ~0021751

Created a pull request for this one:
https://github.com/project-jedi/jvcl/pull/96

Issue History

Date Modified Username Field Change
2018-07-05 17:59 swright New Issue
2018-07-18 16:05 obones Note Added: 0021548
2018-07-18 16:05 obones Status new => feedback
2018-07-18 17:38 swright File Added: WGTest.zip
2018-07-18 17:39 swright Note Added: 0021555
2019-04-26 20:26 mh Note Added: 0021751
2019-04-30 15:15 obones Status feedback => resolved
2019-04-30 15:15 obones Fixed in Version => Daily / GIT
2019-04-30 15:15 obones Resolution open => fixed
2019-04-30 15:15 obones Assigned To => obones