summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarlos <caiosignor@gmail.com>2020-04-17 16:08:49 -0300
committerJoão Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>2020-04-29 12:13:38 -0300
commit39adc0b580d434ecd1001ea72e3ad66f3df98523 (patch)
tree23efad6f6de3b9980df96e58b7c8923fd32f6c4a
parent4e346e2c06c26928420dcf0deb077b01d84839cb (diff)
downloadefl-39adc0b580d434ecd1001ea72e3ad66f3df98523.tar.gz
eina_sched_win32 code convention
-rw-r--r--src/lib/eina/eina_sched_win32.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/src/lib/eina/eina_sched_win32.c b/src/lib/eina/eina_sched_win32.c
index eaacdda0fd..da2a84daae 100644
--- a/src/lib/eina/eina_sched_win32.c
+++ b/src/lib/eina/eina_sched_win32.c
@@ -21,6 +21,7 @@
# define WIN32_LEAN_AND_MEAN
#endif
#include <Windows.h>
+#undef WIN32_LEAN_AND_MEAN
EAPI void eina_sched_prio_drop(void)
{
@@ -32,33 +33,33 @@ EAPI void eina_sched_prio_drop(void)
sched_priority = GetThreadPriority((HANDLE)pthread_id);
if (EINA_UNLIKELY(sched_priority == THREAD_PRIORITY_TIME_CRITICAL))
- {
- sched_priority -= RTNICENESS;
+ {
+ sched_priority -= RTNICENESS;
- /* We don't change the policy */
- if (sched_priority < 1)
- {
- EINA_LOG_INFO("RT prio < 1, setting to 1 instead");
- sched_priority = 1;
- }
- if (!SetThreadPriority((HANDLE)pthread_id, sched_priority))
- {
- EINA_LOG_ERR("Unable to query sched parameters");
- }
- }
+ /* We don't change the policy */
+ if (sched_priority < 1)
+ {
+ EINA_LOG_INFO("RT prio < 1, setting to 1 instead");
+ sched_priority = 1;
+ }
+ if (!SetThreadPriority((HANDLE)pthread_id, sched_priority))
+ {
+ EINA_LOG_ERR("Unable to query sched parameters");
+ }
+ }
else
- {
- sched_priority += NICENESS;
+ {
+ sched_priority += NICENESS;
- /* We don't change the policy */
- if (sched_priority > THREAD_PRIORITY_TIME_CRITICAL)
- {
- EINA_LOG_INFO("Max niceness reached; keeping max (THREAD_PRIORITY_TIME_CRITICAL)");
- sched_priority = THREAD_PRIORITY_TIME_CRITICAL;
- }
- if (!SetThreadPriority((HANDLE)pthread_id, sched_priority))
- {
- EINA_LOG_ERR("Unable to query sched parameters");
- }
- }
+ /* We don't change the policy */
+ if (sched_priority > THREAD_PRIORITY_TIME_CRITICAL)
+ {
+ EINA_LOG_INFO("Max niceness reached; keeping max (THREAD_PRIORITY_TIME_CRITICAL)");
+ sched_priority = THREAD_PRIORITY_TIME_CRITICAL;
+ }
+ if (!SetThreadPriority((HANDLE)pthread_id, sched_priority))
+ {
+ EINA_LOG_ERR("Unable to query sched parameters");
+ }
+ }
}