View Issue Details

IDProjectCategoryView StatusLast Update
0005027JEDI VCL00 JVCL Componentspublic2011-06-10 16:10
ReporterujrAssigned ToAHUser 
PrioritynormalSeveritymajorReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.40 
Summary0005027: JvScheduledEvents - race condition when handling WM_TIMECHANGE
DescriptionHello,
in implementation of issue 0003355 there seems to be a race condition. WndProc has a loop through all events that is not protected by the scheduler threads critical section.
I suggest something like
-------
      WM_TIMECHANGE:
        begin
          // Mantis 3355: Time has changed, mark all running schedules as
          // "to be restarted", stop and then restart them.
          List := TList.Create;
          try
            { +++ }
            ScheduleThread.Lock;
            { ### }
            for I := 0 to FEvents.Count - 1 do
            begin
              if FEvents[I].State in [sesTriggered, sesExecuting, sesPaused] then
              begin
                List.Add(FEvents[I]);
                FEvents[I].Stop;
              end;
            end;
            for I := 0 to List.Count - 1 do
            begin
              TJvEventCollectionItem(List[I]).Start;
            end;
          finally
            { +++ }
            ScheduleThread.Unlock;
            { ### }
            List.Free;
          end;
        end;
-------
TagsNo tags attached.

Activities

obones

2009-12-04 15:27

administrator   ~0016943

Thanks for this, we will review it

AHUser

2010-05-16 14:57

developer   ~0017392

Fixed in SVN.

Issue History

Date Modified Username Field Change
2009-11-19 15:15 ujr New Issue
2009-12-04 15:27 obones Note Added: 0016943
2009-12-04 15:27 obones Status new => acknowledged
2010-05-16 14:57 AHUser Note Added: 0017392
2010-05-16 14:57 AHUser Status acknowledged => resolved
2010-05-16 14:57 AHUser Fixed in Version => Daily / SVN
2010-05-16 14:57 AHUser Resolution open => fixed
2010-05-16 14:57 AHUser Assigned To => AHUser
2011-06-10 16:10 obones Fixed in Version Daily / SVN => 3.40