Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005027 [JEDI VCL] 00 JVCL Components major N/A 2009-11-19 15:15 2011-06-10 16:10
Reporter ujr View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0005027: JvScheduledEvents - race condition when handling WM_TIMECHANGE
Description Hello,
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;
-------
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0016943)
obones (administrator)
2009-12-04 15:27

Thanks for this, we will review it
(0017392)
AHUser (developer)
2010-05-16 14:57

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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker