summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarlos <caiosignor@gmail.com>2020-04-22 13:27:16 -0300
committerJoão Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>2020-04-29 12:13:38 -0300
commitc8960c2006734faf5c8009de917cd8f39d1cda1d (patch)
tree0ffcc4dfa3acdbf33533d7fbb9f7e3f52bc467ab
parent59f07e1f86c4fa0e363c7cbefd2882add2320d3b (diff)
code style
-rw-r--r--src/lib/eina/eina_debug_timer.c40
-rw-r--r--src/lib/eina/eina_inline_thread_posix.x3
-rw-r--r--src/lib/eina/eina_inline_thread_win32.x10
-rw-r--r--src/lib/eina/eina_sched_posix.c3
4 files changed, 31 insertions, 25 deletions
diff --git a/src/lib/eina/eina_debug_timer.c b/src/lib/eina/eina_debug_timer.c
index 9bbe7214f5..bdb971f8d3 100644
--- a/src/lib/eina/eina_debug_timer.c
+++ b/src/lib/eina/eina_debug_timer.c
@@ -119,27 +119,27 @@ _monitor(void *_data EINA_UNUSED)
119 119
120 /* Some timer has been add/removed or we need to exit */ 120 /* Some timer has been add/removed or we need to exit */
121 if (ret) 121 if (ret)
122 { 122 {
123 char c; 123 char c;
124 if (read(pipeToThread[0], &c, 1) != 1) break; 124 if (read(pipeToThread[0], &c, 1) != 1) break;
125 } 125 }
126 else 126 else
127 { 127 {
128 Eina_List *itr, *itr2, *renew = NULL; 128 Eina_List *itr, *itr2, *renew = NULL;
129 Eina_Debug_Timer *t; 129 Eina_Debug_Timer *t;
130 eina_spinlock_take(&_lock); 130 eina_spinlock_take(&_lock);
131 EINA_LIST_FOREACH_SAFE(_timers, itr, itr2, t) 131 EINA_LIST_FOREACH_SAFE(_timers, itr, itr2, t)
132 { 132 {
133 if (itr == _timers || t->rel_time == 0) 133 if (itr == _timers || t->rel_time == 0)
134 { 134 {
135 _timers = eina_list_remove(_timers, t); 135 _timers = eina_list_remove(_timers, t);
136 if (t->cb(t->data)) renew = eina_list_append(renew, t); 136 if (t->cb(t->data)) renew = eina_list_append(renew, t);
137 else free(t); 137 else free(t);
138 } 138 }
139 } 139 }
140 EINA_LIST_FREE(renew, t) _timer_append(t); 140 EINA_LIST_FREE(renew, t) _timer_append(t);
141 eina_spinlock_release(&_lock); 141 eina_spinlock_release(&_lock);
142 } 142 }
143 } 143 }
144#endif 144#endif
145 _thread_runs = EINA_FALSE; 145 _thread_runs = EINA_FALSE;
diff --git a/src/lib/eina/eina_inline_thread_posix.x b/src/lib/eina/eina_inline_thread_posix.x
index 7c8dcac8ee..9bb5698de8 100644
--- a/src/lib/eina/eina_inline_thread_posix.x
+++ b/src/lib/eina/eina_inline_thread_posix.x
@@ -133,6 +133,7 @@ _eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable)
133 return r == 0; 133 return r == 0;
134} 134}
135 135
136static inline void _eina_thread_cancel_checkpoint(){ 136static inline void
137_eina_thread_cancel_checkpoint(){
137 pthread_testcancel(); 138 pthread_testcancel();
138} \ No newline at end of file 139} \ No newline at end of file
diff --git a/src/lib/eina/eina_inline_thread_win32.x b/src/lib/eina/eina_inline_thread_win32.x
index a1d10d35b3..65a6aa7ed3 100644
--- a/src/lib/eina/eina_inline_thread_win32.x
+++ b/src/lib/eina/eina_inline_thread_win32.x
@@ -45,11 +45,12 @@ _eina_thread_join(Eina_Thread t)
45DWORD WINAPI 45DWORD WINAPI
46_eina_thread_func(void *params) 46_eina_thread_func(void *params)
47{ 47{
48 return (DWORD)((Eina_Win32_Thread_Func *)params)->func((void *) 48 return (DWORD)((Eina_Win32_Thread_Func *)params)->
49((Eina_Win32_Thread_Func *)params)->data); 49 func((void *)((Eina_Win32_Thread_Func *)params)->data);
50} 50}
51 51
52static inline void _eina_thread_set_priority(Eina_Thread_Priority prio, Eina_Thread *t) 52static inline void
53_eina_thread_set_priority(Eina_Thread_Priority prio, Eina_Thread *t)
53{ 54{
54 55
55 int nPriority = THREAD_PRIORITY_NORMAL; 56 int nPriority = THREAD_PRIORITY_NORMAL;
@@ -68,6 +69,9 @@ static inline void _eina_thread_set_priority(Eina_Thread_Priority prio, Eina_Thr
68 case EINA_THREAD_IDLE: 69 case EINA_THREAD_IDLE:
69 nPriority = THREAD_PRIORITY_IDLE; 70 nPriority = THREAD_PRIORITY_IDLE;
70 break; 71 break;
72 default:
73 nPriority = THREAD_PRIORITY_NORMAL;
74 break;
71 } 75 }
72 76
73 SetThreadPriority((HANDLE)*t, nPriority); 77 SetThreadPriority((HANDLE)*t, nPriority);
diff --git a/src/lib/eina/eina_sched_posix.c b/src/lib/eina/eina_sched_posix.c
index 6353c9917f..7a4b364ff1 100644
--- a/src/lib/eina/eina_sched_posix.c
+++ b/src/lib/eina/eina_sched_posix.c
@@ -23,7 +23,8 @@
23#include <errno.h> 23#include <errno.h>
24#include <pthread.h> 24#include <pthread.h>
25 25
26EAPI void eina_sched_prio_drop(void) 26EAPI void
27eina_sched_prio_drop(void)
27{ 28{
28 struct sched_param param; 29 struct sched_param param;
29 int pol, ret; 30 int pol, ret;