mirror of
https://github.com/13hannes11/UU_la_parallel_programming_practical_assignments.git
synced 2024-09-04 00:50:58 +02:00
17 lines
244 B
C++
17 lines
244 B
C++
#include <mutex>
|
|
|
|
class Node {
|
|
public:
|
|
int data;
|
|
Node* next;
|
|
std::mutex mut;
|
|
public:
|
|
void lock();
|
|
void unlock();
|
|
};
|
|
void Node::lock() {
|
|
this->mut.lock();
|
|
}
|
|
void Node::unlock() {
|
|
this->mut.unlock();
|
|
} |