#include
#include
std::mutex door; // mutex declaration
std::vector v; // shared data
door.lock();
/*-----------------------*/
/* This is a thread-safe zone: just one thread at the time allowed
*
* Unique ownership of vector v guaranteed
*/
/*-----------------------*/
door.unlock();