summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarlos <caiosignor@gmail.com>2020-04-17 16:42:10 -0300
committerJoão Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>2020-04-29 12:13:38 -0300
commit00dd023f1228c693862c679b7391d9105187d98e (patch)
treeec691f970219d2495ec3950eae93b25e589a3148
parent39adc0b580d434ecd1001ea72e3ad66f3df98523 (diff)
EINA_THREAD_JOIN_CANCELED just in eina_thread.h and removed some unecessary cast
-rw-r--r--src/lib/eina/eina_sched_win32.c10
-rw-r--r--src/lib/eina/eina_thread.h1
-rw-r--r--src/lib/eina/eina_thread_posix.h1
-rw-r--r--src/lib/eina/eina_thread_win32.h2
4 files changed, 6 insertions, 8 deletions
diff --git a/src/lib/eina/eina_sched_win32.c b/src/lib/eina/eina_sched_win32.c
index da2a84daae..cbe0247add 100644
--- a/src/lib/eina/eina_sched_win32.c
+++ b/src/lib/eina/eina_sched_win32.c
@@ -25,12 +25,12 @@
25 25
26EAPI void eina_sched_prio_drop(void) 26EAPI void eina_sched_prio_drop(void)
27{ 27{
28 Eina_Thread pthread_id; 28 Eina_Thread thread_id;
29 int sched_priority; 29 int sched_priority;
30 30
31 pthread_id = eina_thread_self(); 31 thread_id = eina_thread_self();
32 32
33 sched_priority = GetThreadPriority((HANDLE)pthread_id); 33 sched_priority = GetThreadPriority(thread_id);
34 34
35 if (EINA_UNLIKELY(sched_priority == THREAD_PRIORITY_TIME_CRITICAL)) 35 if (EINA_UNLIKELY(sched_priority == THREAD_PRIORITY_TIME_CRITICAL))
36 { 36 {
@@ -42,7 +42,7 @@ EAPI void eina_sched_prio_drop(void)
42 EINA_LOG_INFO("RT prio < 1, setting to 1 instead"); 42 EINA_LOG_INFO("RT prio < 1, setting to 1 instead");
43 sched_priority = 1; 43 sched_priority = 1;
44 } 44 }
45 if (!SetThreadPriority((HANDLE)pthread_id, sched_priority)) 45 if (!SetThreadPriority(thread_id, sched_priority))
46 { 46 {
47 EINA_LOG_ERR("Unable to query sched parameters"); 47 EINA_LOG_ERR("Unable to query sched parameters");
48 } 48 }
@@ -57,7 +57,7 @@ EAPI void eina_sched_prio_drop(void)
57 EINA_LOG_INFO("Max niceness reached; keeping max (THREAD_PRIORITY_TIME_CRITICAL)"); 57 EINA_LOG_INFO("Max niceness reached; keeping max (THREAD_PRIORITY_TIME_CRITICAL)");
58 sched_priority = THREAD_PRIORITY_TIME_CRITICAL; 58 sched_priority = THREAD_PRIORITY_TIME_CRITICAL;
59 } 59 }
60 if (!SetThreadPriority((HANDLE)pthread_id, sched_priority)) 60 if (!SetThreadPriority(thread_id, sched_priority))
61 { 61 {
62 EINA_LOG_ERR("Unable to query sched parameters"); 62 EINA_LOG_ERR("Unable to query sched parameters");
63 } 63 }
diff --git a/src/lib/eina/eina_thread.h b/src/lib/eina/eina_thread.h
index bea52685e0..22fb218d7a 100644
--- a/src/lib/eina/eina_thread.h
+++ b/src/lib/eina/eina_thread.h
@@ -351,6 +351,7 @@ struct _Eina_Thread_Call
351 int affinity; 351 int affinity;
352}; 352};
353 353
354EAPI const void *EINA_THREAD_JOIN_CANCELED = EINA_THREAD_CANCELED;
354/** 355/**
355 * @} 356 * @}
356 */ 357 */
diff --git a/src/lib/eina/eina_thread_posix.h b/src/lib/eina/eina_thread_posix.h
index e98fe25bcf..470e5a359f 100644
--- a/src/lib/eina/eina_thread_posix.h
+++ b/src/lib/eina/eina_thread_posix.h
@@ -45,6 +45,5 @@ typedef uintptr_t Eina_Thread;
45 * @typedef Eina_Thread 45 * @typedef Eina_Thread
46 * Type for a generic thread. 46 * Type for a generic thread.
47 */ 47 */
48EAPI const void *EINA_THREAD_JOIN_CANCELED = EINA_THREAD_CANCELED;
49 48
50#endif \ No newline at end of file 49#endif \ No newline at end of file
diff --git a/src/lib/eina/eina_thread_win32.h b/src/lib/eina/eina_thread_win32.h
index c28c1fe9b2..8254be720b 100644
--- a/src/lib/eina/eina_thread_win32.h
+++ b/src/lib/eina/eina_thread_win32.h
@@ -44,6 +44,4 @@
44 */ 44 */
45typedef HANDLE Eina_Thread; 45typedef HANDLE Eina_Thread;
46 46
47EAPI const void *EINA_THREAD_JOIN_CANCELED = EINA_THREAD_CANCELED;
48
49#endif \ No newline at end of file 47#endif \ No newline at end of file