From 9e0d2271729634381c97a5c526c536ef08f7ffe7 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Sat, 21 Nov 2015 10:23:45 -0800 Subject: [PATCH] - attempt to see if this fixes thread locking performance issues in windows --- source/shared_lib/sources/platform/common/simple_threads.cpp | 5 +++-- source/shared_lib/sources/platform/posix/socket.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/shared_lib/sources/platform/common/simple_threads.cpp b/source/shared_lib/sources/platform/common/simple_threads.cpp index 4f61d32c7..fd9f3eb7b 100644 --- a/source/shared_lib/sources/platform/common/simple_threads.cpp +++ b/source/shared_lib/sources/platform/common/simple_threads.cpp @@ -664,8 +664,9 @@ void LogFileThread::addLogEntry(SystemFlags::DebugType type, string logEntry) { bool LogFileThread::checkSaveCurrentLogBufferToDisk() { bool ret = false; - if(difftime(time(NULL),lastSaveToDisk) >= 5 || - LogFileThread::getLogEntryBufferCount() >= 1000000) { + if(difftime(time(NULL),lastSaveToDisk) >= 5.0 || + (difftime(time(NULL), lastSaveToDisk) >= 2.0 && + LogFileThread::getLogEntryBufferCount() >= 1000000)) { lastSaveToDisk = time(NULL); ret = true; } diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index bece9bd75..60de346fb 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1703,7 +1703,7 @@ bool Socket::isReadable(bool lockMutex) { MutexSafeWrapper safeMutex(NULL,CODE_AT_LINE); if(lockMutex == true) { - safeMutex.setMutex(dataSynchAccessorRead,CODE_AT_LINE); + //safeMutex.setMutex(dataSynchAccessorRead,CODE_AT_LINE); } if(isSocketValid() == false) return false;