I have adapted util_threads.h to use C++11 threads and locks as a drop-in substitute for the boost versions, avoiding the use of pthread with VC++2013 (see below). This patch replaces the use of unique_lock with the lighter lock_guard. This probably makes little difference to performance (as they both uses the same underlying mutexes) but it makes the intention of the code a bit clearer where no explicit (un)locking or functionality such as waiting is required.
#ifdef CCL_USE_CPP11 #include <thread> #include <condition_variable> #include <mutex> #include <queue> #include "util_function.h" CCL_NAMESPACE_BEGIN /* use boost for mutexes, thread */ typedef std::mutex thread_mutex; typedef std::unique_lock<thread_mutex> thread_scoped_lock; typedef std::lock_guard<thread_mutex> thread_guard_lock; /* lighter weight than unique lock, documents intent */ typedef std::condition_variable thread_condition_variable; typedef std::thread thread; #else #include <boost/thread.hpp> #include <pthread.h> #include <queue> #include "util_function.h" CCL_NAMESPACE_BEGIN /* use boost for mutexes */ typedef boost::mutex thread_mutex; typedef boost::mutex::scoped_lock thread_scoped_lock; typedef boost::mutex::scoped_lock thread_guard_lock; typedef boost::condition_variable thread_condition_variable; #define function_bind boost::bind