[fpc-devel] StdOut capture for FPC RTL

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Nov 25 13:21:49 CET 2010


On 25 Nov 2010, at 12:24, Anton Kavalenka wrote:

> What I have to do to properly initialize these defaults for new  
> threads AFTER capturing StdOut?

Store a copy of your stdout in a global variable, and after creating a  
new thread

   close(stdout);
   stdout:=myglobalstdout;

(and maybe the same for "output").

One possible problem: the output handles are automatically flushed  
when a thread exits (so that may cause synchronisation issues).


Jonas



More information about the fpc-devel mailing list