Standard Interface Library
For Linux and Windows
All kind of list support enumerators...
The standard way | The Sil way |
---|
var |
var |
An example with threads...
The standard way | The Sil way |
---|
type TMyThread = class(TThread) |
type
TForm1 = class(TForm, IRunnable) procedure FormCreate(Sender:
TObject); private FMyThread: IThread; protected // interface IRunnable procedure Run(const Thread: IThread); end; procedure TForm1.FormCreate(Sender: TObject); begin FMyThread := Sil.Os.Thread.Spawn(Self, True); // some setup ... FMyThread.Resume; end; procedure TForm1.Run(const Thread: IThread); begin // thread code here ... end; |