interlocked1.pp 153 B

12345678910
  1. var
  2. target : longint;
  3. begin
  4. target:=1234;
  5. InterLockedCompareExchange(target,4321,1234);
  6. if target<>4321 then
  7. halt(1);
  8. writeln('ok');
  9. end.