1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

Remove last priority flag in deference to queue size checks

This commit is contained in:
Joshua Perry 2018-08-06 10:28:37 -06:00
parent b536cb93f4
commit e1bc2fd055

View File

@ -2625,7 +2625,6 @@ void LogThread(THREAD *thread, void *param)
bool flag = false; bool flag = false;
char current_file_name[MAX_SIZE]; char current_file_name[MAX_SIZE];
char current_logfile_datename[MAX_SIZE]; char current_logfile_datename[MAX_SIZE];
bool last_priority_flag = false;
bool log_date_changed = false; bool log_date_changed = false;
// Validate arguments // Validate arguments
if (thread == NULL || param == NULL) if (thread == NULL || param == NULL)
@ -2729,23 +2728,15 @@ static bool LogThreadWriteGeneral(LOG *log_object, BUF *buffer, IO **io, bool *l
if (num >= LOG_ENGINE_SAVE_START_CACHE_COUNT) if (num >= LOG_ENGINE_SAVE_START_CACHE_COUNT)
{ {
// Raise the priority // Raise the priority
if (last_priority_flag == false)
{
Debug("LOG_THREAD: MsSetThreadPriorityRealtime\n"); Debug("LOG_THREAD: MsSetThreadPriorityRealtime\n");
MsSetThreadPriorityRealtime(); MsSetThreadPriorityRealtime();
last_priority_flag = true;
}
} }
if (num < (LOG_ENGINE_SAVE_START_CACHE_COUNT / 2)) if (num < (LOG_ENGINE_SAVE_START_CACHE_COUNT / 2))
{ {
// Restore the priority // Restore the priority
if (last_priority_flag)
{
Debug("LOG_THREAD: MsSetThreadPriorityIdle\n"); Debug("LOG_THREAD: MsSetThreadPriorityIdle\n");
MsSetThreadPriorityIdle(); MsSetThreadPriorityIdle();
last_priority_flag = false;
}
} }
#endif // OS_WIN32 #endif // OS_WIN32