I am currently working on a multi-threaded application that will be deployed on arm and ppc architectures. I have problems with pthread_cancel on my hand.
pthread_cancel on the hand does not behave the same with ppc. The thread is canceled, but the destructor of the local thread variable is not called on the hand. I also tried to explicitly define the undo cleanup handler procedure set via pthread_cleanup_push. But it is not called when the thread is canceled.
The code works fine with ppc. When a thread is canceled, a local variable destructor is called. And when I explicitly defined the cleanup handler, it was called and executed when pthread_cancel was called.
Am I missing something? Perhaps some compiler options?
- Programming Language: C ++
- Compiled by: arm-linux-g ++ / powerpc-linux-g ++
- OS: Linux
EDIT:
I found a similar problem registered in this libc error .
Using gcc instead of g ++ and adding the -fno-exception option to the compiler did the trick. But I really want to understand the essence of this problem. Also, the -fno-exception exception means that I will not be able to handle exception handling in my application, and not that I am using it now, but I could be in the future.
Thanks.
source
share