prog.cpp:6:19: error: ‘uint32_t’ has not been declared
void lock(uint32_t id, cmd_mod mod)
^~~~~~~~
prog.cpp:6:32: error: ‘cmd_mod’ has not been declared
void lock(uint32_t id, cmd_mod mod)
^~~~~~~
prog.cpp:32:20: error: ‘uint32_t’ has not been declared
void enque(uint32_t tid)
^~~~~~~~
prog.cpp:40:14: error: ‘list’ in namespace ‘std’ does not name a template type
std::list<uint32_t> que_;
^~~~
prog.cpp:41:14: error: ‘mutex’ in namespace ‘std’ does not name a type
std::mutex wait_mtx_;
^~~~~
prog.cpp:42:14: error: ‘mutex’ in namespace ‘std’ does not name a type
std::mutex mtx_;
^~~~~
prog.cpp:43:14: error: ‘condition_variable’ in namespace ‘std’ does not name a type
std::condition_variable cv_;
^~~~~~~~~~~~~~~~~~
prog.cpp: In member function ‘void sequential_mutex::lock(int, int)’:
prog.cpp:8:17: error: ‘unique_lock’ is not a member of ‘std’
std::unique_lock<std::mutex> wait_lock(wait_mtx_);
^~~
prog.cpp:8:34: error: ‘mutex’ is not a member of ‘std’
std::unique_lock<std::mutex> wait_lock(wait_mtx_);
^~~
prog.cpp:8:56: error: ‘wait_mtx_’ was not declared in this scope
std::unique_lock<std::mutex> wait_lock(wait_mtx_);
^~~~~~~~~
prog.cpp:8:65: error: ‘wait_lock’ was not declared in this scope
std::unique_lock<std::mutex> wait_lock(wait_mtx_);
^
prog.cpp:10:20: error: ‘que_’ was not declared in this scope
if(que_.empty() && mtx_.try_lock())
^~~~
prog.cpp:10:36: error: ‘mtx_’ was not declared in this scope
if(que_.empty() && mtx_.try_lock())
^~~~
prog.cpp:13:27: error: ‘cmd_mod’ has not been declared
if(mod != cmd_mod::skip_enque)
^~~~~~~
prog.cpp:14:25: error: ‘que_’ was not declared in this scope
que_.push_back(id);
^~~~
prog.cpp:16:17: error: ‘cv_’ was not declared in this scope
cv_.wait(wait_lock, [this, id](){
^~~
prog.cpp: In lambda function:
prog.cpp:17:38: error: ‘que_’ was not declared in this scope
return id == que_.front();
^~~~
prog.cpp: In member function ‘void sequential_mutex::lock(int, int)’:
prog.cpp:20:30: error: ‘que_’ was not declared in this scope
assert(id == que_.front());
^~~~
prog.cpp:20:42: error: ‘assert’ was not declared in this scope
assert(id == que_.front());
^
prog.cpp:23:17: error: ‘mtx_’ was not declared in this scope
mtx_.lock();
^~~~
prog.cpp: In member function ‘void sequential_mutex::unlock()’:
prog.cpp:28:17: error: ‘mtx_’ was not declared in this scope
mtx_.unlock();
^~~~
prog.cpp:29:17: error: ‘cv_’ was not declared in this scope
cv_.notify_all();
^~~
prog.cpp: In member function ‘void sequential_mutex::enque(int)’:
prog.cpp:34:17: error: ‘unique_lock’ is not a member of ‘std’
std::unique_lock<std::mutex> wait_lock(wait_mtx_);
^~~
prog.cpp:34:34: error: ‘mutex’ is not a member of ‘std’
std::unique_lock<std::mutex> wait_lock(wait_mtx_);
^~~
prog.cpp:34:56: error: ‘wait_mtx_’ was not declared in this scope
std::unique_lock<std::mutex> wait_lock(wait_mtx_);
^~~~~~~~~
prog.cpp:34:65: error: ‘wait_lock’ was not declared in this scope
std::unique_lock<std::mutex> wait_lock(wait_mtx_);
^
prog.cpp:36:17: error: ‘que_’ was not declared in this scope
que_.push_back(tid);
^~~~