id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 5719,pthread mutex in getnameinfo_emulation,olim@…,chris_kohlhoff,"In getnameinfo_emulation() a static pthread_mutex_t is initialized with PTHREAD_MUTEX_INITIALIZER, but pthread_mutex_init() is never called for the mutex. Although this may work on unix/linux, on other systems that emulate posix, pthread_mutex_init() must be called before the mutex is used, otherwise the underlying mutex is never created. Wouldn't it be better to use the wrapper class boost::asio::detail::posix_mutex instead of using posix directly? Actually, you can use boost::asio::detail::mutex instead and change the conditional macro to #if !defined(BOOST_WINDOWS). In addition, why not use a scoped lock (i.e. boost::asio::detail::mutex::scoped_lock) to perform the actual locking and unlocking of the mutex? Then you would only need one #if defined() instead of two. I have also attached a patch of the changes I described above. (Warning, I have not tried compiling with the changes, but you should get the idea)",Bugs,closed,Boost 1.48.0,asio,Boost 1.47.0,Problem,invalid,,