Skip to content

Commit

Permalink
Merge pull request #69 from ybm2dyd/20181226-mutex_bug
Browse files Browse the repository at this point in the history
修复互斥锁bug
  • Loading branch information
jonygli authored Aug 13, 2019
2 parents 55d1710 + f73a98e commit 70dde05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions inc/behaviac/common/logger/logmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ namespace behaviac {
Logs_t m_logs;
const char* m_logFilePath;
static LogManager* ms_instance;
class behaviac::Mutex mutex_;
};
}//namespace behaviac

Expand Down
3 changes: 1 addition & 2 deletions src/common/logger/logmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ namespace behaviac {
//printf(buffer.c_str());

if (fp) {
behaviac::Mutex cs;
behaviac::ScopedLock lock(cs);
behaviac::ScopedLock lock(mutex_);

fwrite(buffer, 1, strlen(buffer), fp);

Expand Down

0 comments on commit 70dde05

Please sign in to comment.