Ver código fonte

* use volatile() to prevent wrong optimizations by llvm

git-svn-id: trunk@40466 -
Jonas Maebe 6 anos atrás
pai
commit
8846041b23
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      tests/test/tmt1.pp

+ 1 - 1
tests/test/tmt1.pp

@@ -55,7 +55,7 @@ begin
      if BeginThread({$ifdef fpc}@{$endif}f,pointer(i)) <> tthreadid(0) then
        inc(started);
 
-   while finished<started do
+   while volatile(finished)<started do
      {$ifdef wince}sleep(10){$endif};
    writeln(finished);
 end.