1.Ï̴߳úÂ룺 procedure TTest.Execute; var i:integer; begin { Place thread code here } OnTerminate:=Form1.Done; if WaitForSingleObject(HMux,INFINITE)=WAIT_OBJECT_0 then begin for i:= 1 to 128 do begin Garry[i]:=form1.Getnum(); sleep(5); end; end; //ReleaseMutex(HMux); end;
end. 2.Ö÷Ìå procedure TForm1.Button1Click(Sender: TObject); begin HMux:=CreateMutex(nil,false,nil); TTest.Create(false); TTest.Create(false); end;
IF THEN ELSEÖжà¸öÌõ¼þÔõôд£¬È磺×Ö·û´®S1£¬S2£¬S3£¬S4¾ùÒª²»Îª¿Õ¡£ ÔõôÑù°ÑËüдµ½IFÖÐÈ¥£¿ Çë¸÷λ°ï°ï棬лл£¡ if (S1<>'') and (S2<>'') and (S3<>'') and (S4<>'') then begin ......