<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Adriaan van Os via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Mi., 9. Okt. 2024, 16:44:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a program on MacOS that calls CoreAudio which calls the application back in a so-called <br>
AURendererCallback in a separate (com.apple.audio.IOThread.client) thread. This is a pthread <br>
created by the system software, not by the FreePascal RTL.<br>
<br>
In that thread, a FreePascal try except block doesn't catch an exception. A globally installed <br>
TExceptProc does. if I look in the RTL code, it looks like a thread created with BeginThread does <br>
some extra things, like calling SysAllocateThreadVars. A comment notes that exception handling <br>
depends on it.<br>
<br>
So, it seems plausible that SysAllocateThreadVars (or the AllocateThreadVars method of the current <br>
TThreadManager) must be called once for pthreads created by the system software ? How ? Obviously <br>
I couldn't use a threadvar that tells me whether AllocateThreadVars has been called already ?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">You already wrote that you might have found a different cause, but nevertheless to clarify: the RTL initialization for the thread (which includes AllocateThreadVars) should already be done transparently by the RTL through hooks provided by pthread. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div>