var
write_semaphore:THandle;
write_semaphore:=CreateSemaphore(0, 1, 1, nil);
procedure TForm1.Button1Click(Sender: TObject);
begin
WaitForSingleObject(com.write_semaphore, INFINITE); // 返回值WAIT_TIMEOUT和WAIT_OBJECT_0
ReleaseSemaphore(com.write_semaphore, 1, nil);
end;
阅读(4895) | 评论(0) | 转发(0) |