I\'m writing a simple C++ program to demonstrate the use of locks. I am using codeblocks
and gnu
gcc
compiler.
#inclu
Many classes of the standard thread library can be replaced with the boost ones. A very easy workaround is to change the entire standard mutex
file with a couple of lines.
#include
namespace std
{
using boost::mutex;
using boost::recursive_mutex;
using boost::lock_guard;
using boost::condition_variable;
using boost::unique_lock;
using boost::thread;
}
And do not forget to link against boost thread library.