What is the differance between boost::details::pool::pthread_mutex and boost::details::pool::null_mutex.
I see that in latest boost version – 1.42, the class boost::details::pool::pthread_mutex was deleted. What should I use instead?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
boost::details::pool::null_mutexis a mutex that does nothing (a lock always succeeds immediately). It’s appropriate when you’re not using threads. The Boost pool library selects what kind of mutex it will use to synchronize access to critical sections with a typedef for the mutex type based on the following snippet fromboost\pool\detail\mutex.hpp:In other words, if the configuration says that no threading is involved (either for Boost as a whole, or for the pool library in particular), then the
null_mutexwill be used (which is basically a nop).If threading is to be supported, then the
boost::mutextype will be used, which comes from the Boost thread library (and will be a pthread-based mutex if your system uses pthreads).