Horje
cpp mutex Code Example
cpp mutex
#include <mutex>
#include <vector>
std::mutex door;    // mutex declaration
std::vector<int> 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();
Source: medium.com




Cpp

Related
c++ find object in vector by attribute Code Example c++ find object in vector by attribute Code Example
how to change colour image to grey in opencv c++ Code Example how to change colour image to grey in opencv c++ Code Example
c++ header boilerplate Code Example c++ header boilerplate Code Example
cuda shared variable Code Example cuda shared variable Code Example
check prime cpp gfg Code Example check prime cpp gfg Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12