Added mutex lock to log output.

This commit is contained in:
barant committed 2019-10-20 09:32:11 -07:00
1 parent 64afc5ab9f
commit 4286a7b449
6 files changed
+9 -5

No files matched your search

+4
View File
@@ -61,6 +61,8 @@ namespace coreutils {
Log::~Log() {
if(output) {
mtx.lock();
std::stringstream out;
out << seq << "." << this->str() << std::endl;;
@@ -73,6 +75,8 @@ namespace coreutils {
std::cout << out.str();
++seq;
mtx.unlock();
}
}