Skip to content

Commit

Permalink
Performance|libcore: Avoid unnecessary mutex locking
Browse files Browse the repository at this point in the history
theLogs() does not need locking after Logs exists.
  • Loading branch information
skyjake committed Nov 2, 2014
1 parent 5c986c2 commit ba04c59
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions doomsday/libcore/src/core/log.cpp
Expand Up @@ -683,6 +683,7 @@ LogEntry &Log::enter(duint32 metadata, String const &format, LogEntry::Args argu

static internal::Logs &theLogs()
{
if(logsPtr.get()) return *logsPtr;
static Lockable lock;
DENG2_GUARD(lock);
if(!logsPtr.get()) logsPtr.reset(new internal::Logs);
Expand Down

0 comments on commit ba04c59

Please sign in to comment.