summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarlos <caiosignor@gmail.com>2020-04-14 13:18:13 -0300
committerJoão Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>2020-04-29 12:13:38 -0300
commit845c3231909edba04ec120fcf7c2c462927a91c6 (patch)
tree030d94fadb9a7dd8d0eaac26020d85c79cb92382
parent2894e8459dd0ee2ed2556d2c265bc671ea2601e7 (diff)
adicionado static inline functions no.x
-rw-r--r--src/lib/eina/eina_inline_thread_posix.x20
-rw-r--r--src/lib/eina/eina_inline_thread_win32.x22
2 files changed, 21 insertions, 21 deletions
diff --git a/src/lib/eina/eina_inline_thread_posix.x b/src/lib/eina/eina_inline_thread_posix.x
index 1eb38e9af3..8f51f2b55e 100644
--- a/src/lib/eina/eina_inline_thread_posix.x
+++ b/src/lib/eina/eina_inline_thread_posix.x
@@ -18,7 +18,7 @@
18 18
19#include "eina_thread_posix.h" 19#include "eina_thread_posix.h"
20 20
21inline void * 21static inline void *
22_eina_thread_join(Eina_Thread t) 22_eina_thread_join(Eina_Thread t)
23{ 23{
24 void *ret = NULL; 24 void *ret = NULL;
@@ -28,7 +28,7 @@ _eina_thread_join(Eina_Thread t)
28 return NULL; 28 return NULL;
29} 29}
30 30
31Eina_Bool _eina_thread_name_set(Eina_Thread thread, char *buf) 31static inline Eina_Bool _eina_thread_name_set(Eina_Thread thread, char *buf)
32{ 32{
33#ifndef __linux__ 33#ifndef __linux__
34 pthread_set_name_np((pthread_t)t, buf); 34 pthread_set_name_np((pthread_t)t, buf);
@@ -38,7 +38,7 @@ Eina_Bool _eina_thread_name_set(Eina_Thread thread, char *buf)
38#endif 38#endif
39} 39}
40 40
41inline Eina_Bool 41static inline Eina_Bool
42_eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), void *data) 42_eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), void *data)
43{ 43{
44 int err; 44 int err;
@@ -86,32 +86,32 @@ _eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), voi
86 return EINA_FALSE; 86 return EINA_FALSE;
87} 87}
88 88
89inline Eina_Bool 89static inline Eina_Bool
90_eina_thread_equal(Eina_Thread t1, Eina_Thread t2) 90_eina_thread_equal(Eina_Thread t1, Eina_Thread t2)
91{ 91{
92 return !!pthread_equal((pthread_t)t1, (pthread_t)t2); 92 return !!pthread_equal((pthread_t)t1, (pthread_t)t2);
93} 93}
94 94
95Eina_Bool _eina_thread_cancel(Eina_Thread thread) 95static inline Eina_Bool _eina_thread_cancel(Eina_Thread thread)
96{ 96{
97 return pthread_cancel((pthread_t)thread); 97 return pthread_cancel((pthread_t)thread);
98} 98}
99 99
100inline Eina_Thread 100static inline Eina_Thread
101_eina_thread_self(void) 101_eina_thread_self(void)
102{ 102{
103 return (Eina_Thread)pthread_self(); 103 return (Eina_Thread)pthread_self();
104} 104}
105 105
106void _eina_thread_setcanceltype(int type, int *oldtype) 106static inline void _eina_thread_setcanceltype(int type, int *oldtype)
107{ 107{
108 pthread_setcanceltype(EINA_THREAD_CANCEL_DEFERRED, &oldtype); 108 pthread_setcanceltype(EINA_THREAD_CANCEL_DEFERRED, &oldtype);
109} 109}
110int _eina_thread_setcancelstate(int type, int *oldtype) 110static inline int _eina_thread_setcancelstate(int type, int *oldtype)
111{ 111{
112 return pthread_setcancelstate(type, &oldtype); 112 return pthread_setcancelstate(type, &oldtype);
113} 113}
114EAPI Eina_Bool 114static inline Eina_Bool
115_eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable) 115_eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable)
116{ 116{
117 int state = cancellable ? EINA_THREAD_CANCEL_ENABLE : EINA_THREAD_CANCEL_DISABLE; 117 int state = cancellable ? EINA_THREAD_CANCEL_ENABLE : EINA_THREAD_CANCEL_DISABLE;
@@ -127,6 +127,6 @@ _eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable)
127 *was_cancellable = (old == EINA_THREAD_CANCEL_ENABLE); 127 *was_cancellable = (old == EINA_THREAD_CANCEL_ENABLE);
128 return r == 0; 128 return r == 0;
129} 129}
130void _eina_thread_cancel_checkpoint(){ 130static inline void _eina_thread_cancel_checkpoint(){
131 pthread_testcancel(); 131 pthread_testcancel();
132} \ No newline at end of file 132} \ 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 5b6044c0d4..820b35645b 100644
--- a/src/lib/eina/eina_inline_thread_win32.x
+++ b/src/lib/eina/eina_inline_thread_win32.x
@@ -34,7 +34,7 @@ typedef struct _Eina_Win32_Thread_Attr
34 DWORD dwCreationFlags; 34 DWORD dwCreationFlags;
35} Eina_Win32_Thread_Attr; 35} Eina_Win32_Thread_Attr;
36 36
37inline void * 37static inline void *
38_eina_thread_join(Eina_Thread t) 38_eina_thread_join(Eina_Thread t)
39{ 39{
40 40
@@ -49,7 +49,7 @@ DWORD WINAPI _eina_thread_func(void *params)
49 return (DWORD)((Eina_Win32_Thread_Func *)params)->func((void *)((Eina_Win32_Thread_Func *)params)->data); 49 return (DWORD)((Eina_Win32_Thread_Func *)params)->func((void *)((Eina_Win32_Thread_Func *)params)->data);
50} 50}
51 51
52inline void _eina_thread_set_priority(Eina_Thread_Priority prio, Eina_Thread *t) 52static inline void _eina_thread_set_priority(Eina_Thread_Priority prio, Eina_Thread *t)
53{ 53{
54 54
55 int nPriority = THREAD_PRIORITY_NORMAL; 55 int nPriority = THREAD_PRIORITY_NORMAL;
@@ -73,7 +73,7 @@ inline void _eina_thread_set_priority(Eina_Thread_Priority prio, Eina_Thread *t)
73 SetThreadPriority((HANDLE)*t, nPriority); 73 SetThreadPriority((HANDLE)*t, nPriority);
74} 74}
75 75
76inline Eina_Bool 76static inline Eina_Bool
77_eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), void *data) 77_eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), void *data)
78{ 78{
79 Eina_Bool ret; 79 Eina_Bool ret;
@@ -109,7 +109,7 @@ _eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), voi
109 return ret; 109 return ret;
110} 110}
111 111
112inline Eina_Bool 112static inline Eina_Bool
113_eina_thread_equal(Eina_Thread t1, Eina_Thread t2) 113_eina_thread_equal(Eina_Thread t1, Eina_Thread t2)
114{ 114{
115 DWORD t1_thread_id = GetThreadId(t1); 115 DWORD t1_thread_id = GetThreadId(t1);
@@ -118,39 +118,39 @@ _eina_thread_equal(Eina_Thread t1, Eina_Thread t2)
118 return (t1_thread_id == t2_thread_id) ? EINA_TRUE : EINA_FALSE; 118 return (t1_thread_id == t2_thread_id) ? EINA_TRUE : EINA_FALSE;
119} 119}
120 120
121inline Eina_Thread 121static inline Eina_Thread
122_eina_thread_self(void) 122_eina_thread_self(void)
123{ 123{
124 return (Eina_Thread)GetCurrentThread(); 124 return (Eina_Thread)GetCurrentThread();
125} 125}
126 126
127inline Eina_Bool _eina_thread_name_set(Eina_Thread thread, char *buf) 127static inline Eina_Bool _eina_thread_name_set(Eina_Thread thread, char *buf)
128{ 128{
129 HRESULT res = SetThreadDescription((HANDLE)thread, (PCWSTR)buf); 129 HRESULT res = SetThreadDescription((HANDLE)thread, (PCWSTR)buf);
130 return HRESULT_CODE(res); 130 return HRESULT_CODE(res);
131} 131}
132 132
133inline Eina_Bool _eina_thread_cancel(Eina_Thread thread) 133static inline Eina_Bool _eina_thread_cancel(Eina_Thread thread)
134{ 134{
135 LPDWORD lpExitCode; 135 LPDWORD lpExitCode;
136 Eina_Bool success = GetExitCodeThread((HANDLE)thread, lpExitCode); 136 Eina_Bool success = GetExitCodeThread((HANDLE)thread, lpExitCode);
137 ExitThread(*lpExitCode); 137 ExitThread(*lpExitCode);
138 return !success; 138 return !success;
139} 139}
140inline UNIMPLEMENTED void _eina_thread_setcanceltype(int type, int *oldtype) 140static inline UNIMPLEMENTED void _eina_thread_setcanceltype(int type, int *oldtype)
141{ 141{
142 #warning _eina_thread_setcanceltype is not implemented. 142 #warning _eina_thread_setcanceltype is not implemented.
143} 143}
144inline UNIMPLEMENTED int _eina_thread_setcancelstate(int type, int *oldtype) 144static inline UNIMPLEMENTED int _eina_thread_setcancelstate(int type, int *oldtype)
145{ 145{
146 #warning _eina_thread_setcancelstate is not implemented. 146 #warning _eina_thread_setcancelstate is not implemented.
147 return 0; 147 return 0;
148} 148}
149inline UNIMPLEMENTED void _eina_thread_cancel_checkpoint(void) 149static inline UNIMPLEMENTED void _eina_thread_cancel_checkpoint(void)
150{ 150{
151 #warning _eina_thread_cancel_checkpoint is not implemented. 151 #warning _eina_thread_cancel_checkpoint is not implemented.
152} 152}
153inline EAPI Eina_Bool 153static inline Eina_Bool
154_eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable) 154_eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable)
155{ 155{
156 int state = cancellable ? EINA_THREAD_CANCEL_ENABLE : EINA_THREAD_CANCEL_DISABLE; 156 int state = cancellable ? EINA_THREAD_CANCEL_ENABLE : EINA_THREAD_CANCEL_DISABLE;