mirror of
https://github.com/13hannes11/UU_la_parallel_programming_practical_assignments.git
synced 2024-09-04 00:50:58 +02:00
refactored FineList to have Node in seperate file
This commit is contained in:
17
Assignment_2/Node.cpp
Normal file
17
Assignment_2/Node.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#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();
|
||||
}
|
||||
Reference in New Issue
Block a user