Friday, 30 June 2017

[gccsdk] pthread shutdown in atexit

I have a mysterious crash in a SDL based program when it attempts to

do a pthread_wait in an atexit handler. The error is:

pthreads: ***fatal error, aborting***

pthread_yield called with context switching disabled.

 

My guess is this means that GCC is shutting down the threads system

before the atexit handler is being called.

 

Is there anything I can do to workaround this problem?

e.g. Is there a function I can call or a variable I can check

to see if threading has been stopped so I can avoid the call?

Or is there a way to detect I'm in an atexit hander?

 

Thanks,

Alan

No comments:

Post a Comment