Keyword: try-catch block, xilkernel, C++
When using a try-catch block in C++ with Xilkernel, the exception is not caught in the threads. It works only in the main function.
C++ requires larger stacks than C applications, and the default thread stack size in Xilkernel is low (1000 byte).
This try-catch block will work when increasing the stack size for threads to 4000 bytes or higher, depending on your actual application. The related parameter is pthread_stack_size in the xilkernel definition.