Question

I am developing a plug-in that runs in several host applications, and which maintains its own threads using the boost::thread library, version 1.53.0.

When running my plug-in in a particular application on Mac, I get a null access error when calling boost::condition_variable::timed_wait(). At the top of the call stack is a call to pthread_getspecific(), which is called from inside the boost thread library.

If I replace timed_wait() with a call to boost::this_thread_sleep(), same behaviour: exception is thrown when pthread_getspecific() is called internally.

This application is the only one which exhibits this kind of behaviour; if I run my plug-in in other hosts, it works as expected.

I don't have much experience with pthreads, but I think the exception must be caused by some properties being set up by the host application. Does anyone have any better idea of what might be going on here?

Thanks!

Was it helpful?

Solution

It turns out that the pthread API calls where not thread safe in my application, causing null pointer crashes whenever I called them in a separate thread.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top