Semaphores in Delphi
- From: Locke <jlocke@xxxxxxx>
- Date: Tue, 06 May 2008 00:17:40 +0100
I'm trying to implement a simple semaphore to protect critical sections of code with the following procedures.
Question is are these safe, or is it possible that 2 threads could slip through EnterCritical at the same time?
Thanks
procedure EnterCritical;
begin
while semaphore do sleep(30);
semaphore:=true;
end;
procedure ExitCritical;
begin
semaphore:=false;
end;
.
- Follow-Ups:
- Re: Semaphores in Delphi
- From: Rob Kennedy
- Re: Semaphores in Delphi
- From: Jamie
- Re: Semaphores in Delphi
- Prev by Date: Re: Delphis End ?
- Next by Date: Re: Delphis End ?
- Previous by thread: Re: Implementing an Expert System
- Next by thread: Re: Semaphores in Delphi
- Index(es):