Is a C++11 mutex compatible with threads NOT created with C++11?

Viewed 1975

I'm learning C++11 and have run into a threading issue. My general question: are C++11 mutexes compatible with threads not created with C++11's standard libraries?

I would like to safely share information between a thread created with C++11 and another thread created by a third-party library that I have no control over.

For example, my application uses PortAudio, which creates its own thread for audio output. I'm not sure if it's using pthreads, or OS-specific threading libraries, but I do know that PortAudio is NOT written in C++11. I want to safely share data between a GUI thread (using a C++11 thread) and the PortAudio thread using a mutex.

Similarly, can I use a C++11 mutex to synchronize QT QThreads and C++11 threads?

4 Answers
Related