[fpc-devel] Exceptions in threads

Mattias Gärtner nc-gaertnma at netcologne.de
Thu Dec 11 16:08:41 CET 2008


Zitat von Florian Klaempfl <florian at freepascal.org>:

> Mattias Gärtner schrieb:
> >> raised ?
> >
> > It should be raised in the starter thread. The question is how to
> > - stop an exception in a thread (try..except)
> > - give it to another thread - the starter thread (giving the object is
> easy, but
> > ...)
> > - continue the helper thread (this will normally free the exception object,
> I
> > need a way to avoid this automatism)
>
> This is why I told you to have a look how Synchronize works ;) Hint:
> AcquireExceptionObject/ReleaseExceptionObject which implement simply
> ref. counting which is respected by the exception handling code.

Wow, I didn't know that Synchronize catches exceptions and gives them back to
the calling thread.
That's exactly what I needed. :)

It works.


Mattias




More information about the fpc-devel mailing list