[fpc-devel] RunError handling and threads

Colin Western mftq75 at dsl.pipex.com
Mon Dec 4 23:18:32 CET 2006


Is there a good reason why RunError does not raise an exception in the 
same way that HandleError does (if SysUtils is installed)? RunError is a 
particularly bad routine to call from a thread as it starts finalizing 
variables that are most likely still in use by other threads. An 
exception makes much more sense in these circumstances.

The place I noticed this was in cthreads.pp, which has many calls to 
RunError, which are invoked if you make a mistake in your thread handling.

My proposal is simply to make RunError call the current HandleError 
function (or at the very least export HandleError from System and call 
it from cthreads)


Colin



More information about the fpc-devel mailing list