- Timestamp:
- Nov 23, 2014, 9:04:03 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 2 2 ChronOS.lps 3 3 lib 4 heaptrclog.trc
-
- Property svn:ignore
-
trunk/Apps/UClock.pas
r4 r5 6 6 7 7 uses 8 Classes, SysUtils, UApp, dateutils ;8 Classes, SysUtils, UApp, dateutils, UKernel; 9 9 10 10 type … … 13 13 14 14 TAppClock = class(TApp) 15 procedure Run ; override;15 procedure Run(Task: TTask); override; 16 16 constructor Create; override; 17 17 end; … … 21 21 { TAppClock } 22 22 23 procedure TAppClock.Run ;23 procedure TAppClock.Run(Task: TTask); 24 24 begin 25 while not T erminated do begin25 while not Task.Terminated do begin 26 26 API.WriteText('test'); 27 27 API.Sleep(OneSecond); -
trunk/ChronOS.lpi
r4 r5 17 17 <StringTable ProductVersion=""/> 18 18 </VersionInfo> 19 <BuildModes Count="1"> 20 <Item1 Name="Default" Default="True"/> 19 <BuildModes Count="2"> 20 <Item1 Name="Debug" Default="True"/> 21 <Item2 Name="Release"> 22 <CompilerOptions> 23 <Version Value="11"/> 24 <Target> 25 <Filename Value="ChronOS"/> 26 </Target> 27 <SearchPaths> 28 <IncludeFiles Value="$(ProjOutDir)"/> 29 <OtherUnitFiles Value="Apps;Platform/Base"/> 30 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 31 </SearchPaths> 32 <Parsing> 33 <SyntaxOptions> 34 <SyntaxMode Value="Delphi"/> 35 <CStyleOperator Value="False"/> 36 <AllowLabel Value="False"/> 37 <CPPInline Value="False"/> 38 </SyntaxOptions> 39 </Parsing> 40 <CodeGeneration> 41 <SmartLinkUnit Value="True"/> 42 <Optimizations> 43 <OptimizationLevel Value="3"/> 44 </Optimizations> 45 </CodeGeneration> 46 <Linking> 47 <Debugging> 48 <GenerateDebugInfo Value="False"/> 49 </Debugging> 50 <LinkSmart Value="True"/> 51 <Options> 52 <Win32> 53 <GraphicApplication Value="True"/> 54 </Win32> 55 </Options> 56 </Linking> 57 </CompilerOptions> 58 </Item2> 21 59 </BuildModes> 22 60 <PublishOptions> … … 126 164 </CodeGeneration> 127 165 <Linking> 166 <Debugging> 167 <UseHeaptrc Value="True"/> 168 </Debugging> 128 169 <Options> 129 170 <Win32> … … 132 173 </Options> 133 174 </Linking> 175 <Other> 176 <CustomOptions Value="-dDEBUG"/> 177 </Other> 134 178 </CompilerOptions> 135 179 <Debugging> -
trunk/ChronOS.lpr
r4 r5 10 10 {$ENDIF} 11 11 Interfaces, // this includes the LCL widgetset 12 Forms, UFormMain, UKernel, UFileSystem, UClock, UMemoryManager, UAPI,12 Forms, SysUtils, UFormMain, UKernel, UFileSystem, UClock, UMemoryManager, UAPI, 13 13 UPlatformBase, UList, UApp, UThreadEx, UMemory; 14 14 15 15 {$R *.res} 16 16 17 {$IFDEF DEBUG} 18 const 19 HeapTraceLog = 'heaptrclog.trc'; 20 {$ENDIF} 21 17 22 begin 23 {$IFDEF DEBUG} 24 // Heap trace 25 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 26 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 27 {$ENDIF} 28 18 29 RequireDerivedFormResource := True; 19 30 Application.Initialize; -
trunk/Platform/Base/UPlatformBase.pas
r4 r5 32 32 33 33 TBaseScheduler = class(TScheduler) 34 function AddTask(Name: string; EntryPoint: T BasicEvent): TTask; override;34 function AddTask(Name: string; EntryPoint: TTaskEvent): TTask; override; 35 35 constructor Create; override; 36 36 destructor Destroy; override; … … 101 101 procedure TCustomThread.Execute; 102 102 begin 103 Task.EntryPoint ;103 Task.EntryPoint(Task); 104 104 end; 105 105 106 106 { TBaseScheduler } 107 107 108 function TBaseScheduler.AddTask(Name: string; EntryPoint: T BasicEvent): TTask;108 function TBaseScheduler.AddTask(Name: string; EntryPoint: TTaskEvent): TTask; 109 109 var 110 110 Task: TBaseTask; … … 135 135 136 136 procedure TBaseScheduler.Stop; 137 var 138 I: Integer; 137 139 begin 138 inherited Start; 140 inherited Stop; 141 for I := 0 to Tasks.Count - 1 do 142 TBaseTask(Tasks[I]).Terminated := True; 139 143 end; 140 144 -
trunk/UApp.pas
r4 r5 6 6 7 7 uses 8 Classes, SysUtils, UList, UApi ;8 Classes, SysUtils, UList, UApi, UKernel; 9 9 10 10 type … … 16 16 constructor Create; virtual; 17 17 destructor Destroy; override; 18 procedure Run ; virtual;18 procedure Run(Task: TTask); virtual; 19 19 end; 20 20 … … 36 36 end; 37 37 38 procedure TApp.Run ;38 procedure TApp.Run(Task: TTask); 39 39 begin 40 40 -
trunk/UKernel.pas
r4 r5 9 9 10 10 type 11 TBasicEvent = procedure of object; 11 TTask = class; 12 13 TTaskEvent = procedure(Task: TTask) of object; 12 14 13 15 TTaskState = (tsStopped, tsRunning, tsSuspended); … … 18 20 Name: string; 19 21 State: TTaskState; 20 EntryPoint: TBasicEvent; 22 Terminated: Boolean; 23 EntryPoint: TTaskEvent; 21 24 constructor Create; virtual; 22 25 end; … … 32 35 procedure Start; virtual; 33 36 procedure Stop; virtual; 34 function AddTask(Name: string; EntryPoint: T BasicEvent): TTask; virtual;37 function AddTask(Name: string; EntryPoint: TTaskEvent): TTask; virtual; 35 38 constructor Create; virtual; 36 39 destructor Destroy; override; … … 39 42 TSchedulerClass = class of TScheduler; 40 43 44 { TDrive } 45 41 46 TDrive = class(TNamedObject) 42 47 FileSystem: TFileSystem; 48 constructor Create; 49 destructor Destroy; override; 43 50 end; 44 51 … … 72 79 UApp; 73 80 81 { TDrive } 82 83 constructor TDrive.Create; 84 begin 85 86 end; 87 88 destructor TDrive.Destroy; 89 begin 90 FileSystem.Free; 91 inherited Destroy; 92 end; 93 74 94 { TDevice } 75 95 … … 103 123 end; 104 124 105 function TScheduler.AddTask(Name: string; EntryPoint: T BasicEvent): TTask;125 function TScheduler.AddTask(Name: string; EntryPoint: TTaskEvent): TTask; 106 126 var 107 127 NewTask: TTask;
Note:
See TracChangeset
for help on using the changeset viewer.