Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
17
Добавлен:
02.05.2014
Размер:
1.37 Кб
Скачать
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,mythrd,syncobjs;

type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
Critical:TCriticalSection;
var firstthread,secondthread,thirdthread,fourthread:TMythread;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
firstthread:=TMythread.Create(edit1);
firstthread.Priority:=tpHigher;
firstthread.Resume;
secondthread:=TMythread.Create(edit2);
secondthread.Priority:=tpnormal;
secondthread.Resume;
thirdthread:=TMythread.Create(edit3);
thirdthread.Priority:=tplower;
thirdthread.Resume;
fourthread:=TMythread.Create(edit4);
fourthread.Priority:=tpidle;
fourthread.Resume;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
critical:=Tcriticalsection.Create;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
critical.Free;
end;








end.
Соседние файлы в папке prior4
  • #
    02.05.2014876 б17Proj.res
  • #
    02.05.2014184 б17Proj.~dpr
  • #
    02.05.20144.99 Кб17Unit1.dcu
  • #
    02.05.201451 б17Unit1.ddp
  • #
    02.05.20141.55 Кб17Unit1.dfm
  • #
    02.05.20141.37 Кб17Unit1.pas
  • #
    02.05.201451 б17Unit1.~ddp
  • #
    02.05.20141.54 Кб17Unit1.~dfm
  • #
    02.05.20141.37 Кб17Unit1.~pas