Browse Source

* fixed datarace in case heaptrc is used

git-svn-id: trunk@6695 -
Jonas Maebe 18 years ago
parent
commit
3348a27a74
1 changed files with 8 additions and 0 deletions
  1. 8 0
      tests/test/tbrtlevt.pp

+ 8 - 0
tests/test/tbrtlevt.pp

@@ -18,6 +18,10 @@ var
 
 procedure tc.execute;
 begin
+  { make sure we don't exit before this thread has initialised, since    }
+  { it can allocate memory in its initialisation, which would cause      }
+  { problems for heaptrc as it goes over the memory map in its exit code }
+  waiting:=true;
   { avoid deadlocks/bugs from causing this test to never quit }
   sleep(1000*20);
   halt(1);
@@ -25,6 +29,7 @@ end;
 
 
 begin
+  waiting:=false;
   tc.create(false);
   event := BasicEventCreate(nil,false,false,'bla');;
   basiceventSetEvent(event);
@@ -43,4 +48,7 @@ begin
       writeln('error');
       halt(1);
     end;
+  basiceventdestroy(event);
+  while not waiting do
+    sleep(20);
 end.