C++ exceptions

I’m developing a C++ application with Digi ESP. I’m using two threads: the main thread and a second thread (created by calling tx_thread_create).

When I throw an exception inside the second thread it jumps to the catch(…) handler inside my main() function.
It doesn’t jump to the correct catch handler inside the thread function itself.

How can I solve this issue?

Example code:

void applicationStart (void)
{
try
{
CreateAndStartThread();
}
catch(…)
{
printf("catched …
"); //<= jumps to here!?
}
}

void ThreadEntry(ULONG EntryInput)
{
try
{
throw 1;
}
catch(int i)
{
printf("catched %d
", i); // <= doesn’t come here
}
}

Note: If I remove the catch(…) I get this error:
terminate called after throwing an instance of ‘int’

Has anybody ever successfully used C++ exceptions and multiple threads?