code style

This commit is contained in:
carlos 2020-04-22 13:27:16 -03:00 committed by João Paulo Taylor Ienczak Zanette
parent 59f07e1f86
commit c8960c2006
4 changed files with 31 additions and 25 deletions

View File

@ -119,27 +119,27 @@ _monitor(void *_data EINA_UNUSED)
/* Some timer has been add/removed or we need to exit */
if (ret)
{
char c;
if (read(pipeToThread[0], &c, 1) != 1) break;
}
{
char c;
if (read(pipeToThread[0], &c, 1) != 1) break;
}
else
{
Eina_List *itr, *itr2, *renew = NULL;
Eina_Debug_Timer *t;
eina_spinlock_take(&_lock);
EINA_LIST_FOREACH_SAFE(_timers, itr, itr2, t)
{
if (itr == _timers || t->rel_time == 0)
{
_timers = eina_list_remove(_timers, t);
if (t->cb(t->data)) renew = eina_list_append(renew, t);
else free(t);
}
}
EINA_LIST_FREE(renew, t) _timer_append(t);
eina_spinlock_release(&_lock);
}
{
Eina_List *itr, *itr2, *renew = NULL;
Eina_Debug_Timer *t;
eina_spinlock_take(&_lock);
EINA_LIST_FOREACH_SAFE(_timers, itr, itr2, t)
{
if (itr == _timers || t->rel_time == 0)
{
_timers = eina_list_remove(_timers, t);
if (t->cb(t->data)) renew = eina_list_append(renew, t);
else free(t);
}
}
EINA_LIST_FREE(renew, t) _timer_append(t);
eina_spinlock_release(&_lock);
}
}
#endif
_thread_runs = EINA_FALSE;

View File

@ -133,6 +133,7 @@ _eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable)
return r == 0;
}
static inline void _eina_thread_cancel_checkpoint(){
static inline void
_eina_thread_cancel_checkpoint(){
pthread_testcancel();
}

View File

@ -45,11 +45,12 @@ _eina_thread_join(Eina_Thread t)
DWORD WINAPI
_eina_thread_func(void *params)
{
return (DWORD)((Eina_Win32_Thread_Func *)params)->func((void *)
((Eina_Win32_Thread_Func *)params)->data);
return (DWORD)((Eina_Win32_Thread_Func *)params)->
func((void *)((Eina_Win32_Thread_Func *)params)->data);
}
static inline void _eina_thread_set_priority(Eina_Thread_Priority prio, Eina_Thread *t)
static inline void
_eina_thread_set_priority(Eina_Thread_Priority prio, Eina_Thread *t)
{
int nPriority = THREAD_PRIORITY_NORMAL;
@ -68,6 +69,9 @@ static inline void _eina_thread_set_priority(Eina_Thread_Priority prio, Eina_Thr
case EINA_THREAD_IDLE:
nPriority = THREAD_PRIORITY_IDLE;
break;
default:
nPriority = THREAD_PRIORITY_NORMAL;
break;
}
SetThreadPriority((HANDLE)*t, nPriority);

View File

@ -23,7 +23,8 @@
#include <errno.h>
#include <pthread.h>
EAPI void eina_sched_prio_drop(void)
EAPI void
eina_sched_prio_drop(void)
{
struct sched_param param;
int pol, ret;