summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-05-04 19:10:10 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-05-04 22:11:44 -0300
commitdf3a9dab23327164eece31deae99617c1551dd1b (patch)
tree53ab233c5192e7313472be8796ecc1fc0bc89270
parent6d37a46e2bde996b2e053c25445f59f5d86490b8 (diff)
windows: Squash with lock and threads
-rw-r--r--src/lib/eina/eina_debug.c13
-rw-r--r--src/lib/eina/eina_lock.c1
-rw-r--r--src/lib/eina/eina_main.c2
3 files changed, 3 insertions, 13 deletions
diff --git a/src/lib/eina/eina_debug.c b/src/lib/eina/eina_debug.c
index 378748852a..aa8db64594 100644
--- a/src/lib/eina/eina_debug.c
+++ b/src/lib/eina/eina_debug.c
@@ -136,9 +136,7 @@ struct _Eina_Debug_Session
136 Eina_Bool deleted : 1; /* set if session is dead */ 136 Eina_Bool deleted : 1; /* set if session is dead */
137}; 137};
138 138
139#ifndef _WIN32
140static void _opcodes_register_all(Eina_Debug_Session *session); 139static void _opcodes_register_all(Eina_Debug_Session *session);
141#endif
142static void _thread_start(Eina_Debug_Session *session); 140static void _thread_start(Eina_Debug_Session *session);
143 141
144EINA_API int 142EINA_API int
@@ -176,7 +174,6 @@ err:
176#endif 174#endif
177} 175}
178 176
179#ifndef _WIN32
180static void 177static void
181_daemon_greet(Eina_Debug_Session *session) 178_daemon_greet(Eina_Debug_Session *session)
182{ 179{
@@ -190,6 +187,7 @@ _daemon_greet(Eina_Debug_Session *session)
190#endif 187#endif
191 int size = 8 + (app_name ? strlen(app_name) : 0) + 1; 188 int size = 8 + (app_name ? strlen(app_name) : 0) + 1;
192 unsigned char *buf = alloca(size); 189 unsigned char *buf = alloca(size);
190
193 int version = SWAP_32(1); // version of protocol we speak 191 int version = SWAP_32(1); // version of protocol we speak
194 int pid = getpid(); 192 int pid = getpid();
195 pid = SWAP_32(pid); 193 pid = SWAP_32(pid);
@@ -259,7 +257,6 @@ end:
259 if (rret <= 0 && packet_buf) free(packet_buf); 257 if (rret <= 0 && packet_buf) free(packet_buf);
260 return rret; 258 return rret;
261} 259}
262#endif
263 260
264EINA_API void 261EINA_API void
265eina_debug_disable() 262eina_debug_disable()
@@ -301,7 +298,6 @@ eina_debug_session_dispatch_get(Eina_Debug_Session *session)
301 else return NULL; 298 else return NULL;
302} 299}
303 300
304#ifndef _WIN32
305static void 301static void
306_static_opcode_register(Eina_Debug_Session *session, 302_static_opcode_register(Eina_Debug_Session *session,
307 int op_id, Eina_Debug_Cb cb) 303 int op_id, Eina_Debug_Cb cb)
@@ -359,7 +355,6 @@ _callbacks_register_cb(Eina_Debug_Session *session, int src_id EINA_UNUSED, void
359 355
360 return EINA_FALSE; 356 return EINA_FALSE;
361} 357}
362#endif
363 358
364static void 359static void
365_opcodes_registration_send(Eina_Debug_Session *session, 360_opcodes_registration_send(Eina_Debug_Session *session,
@@ -404,7 +399,6 @@ _opcodes_registration_send(Eina_Debug_Session *session,
404 free(buf); 399 free(buf);
405} 400}
406 401
407#ifndef _WIN32
408static void 402static void
409_opcodes_register_all(Eina_Debug_Session *session) 403_opcodes_register_all(Eina_Debug_Session *session)
410{ 404{
@@ -445,7 +439,6 @@ _opcodes_unregister_all(Eina_Debug_Session *session)
445 439
446#define LENGTH_OF_SOCKADDR_UN(s) \ 440#define LENGTH_OF_SOCKADDR_UN(s) \
447 (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path)) 441 (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
448#endif
449 442
450static Eina_Debug_Session * 443static Eina_Debug_Session *
451_session_create(int fd) 444_session_create(int fd)
@@ -544,7 +537,6 @@ err:
544// way. this is an alternative to using external debuggers so we can get 537// way. this is an alternative to using external debuggers so we can get
545// users or developers to get useful information about an app at all times 538// users or developers to get useful information about an app at all times
546 539
547#ifndef _WIN32
548static void * 540static void *
549_monitor(void *_data) 541_monitor(void *_data)
550{ 542{
@@ -554,7 +546,7 @@ _monitor(void *_data)
554 _opcodes_register_all(session); 546 _opcodes_register_all(session);
555 547
556 // set a name for this thread for system debugging 548 // set a name for this thread for system debugging
557#ifdef EINA_HAVE_PTHREAD_SETNAME || EINA_HAVE_WIN32_THREAD_SETNAME 549#if defined(EINA_HAVE_PTHREAD_SETNAME) || defined(EINA_HAVE_WIN32_THREAD_SETNAME)
558 eina_thread_name_set(eina_thread_self(), "Edbg-mon"); 550 eina_thread_name_set(eina_thread_self(), "Edbg-mon");
559#endif 551#endif
560 552
@@ -591,7 +583,6 @@ _monitor(void *_data)
591 } 583 }
592 return NULL; 584 return NULL;
593} 585}
594#endif
595 586
596// start up the debug monitor if we haven't already 587// start up the debug monitor if we haven't already
597static void 588static void
diff --git a/src/lib/eina/eina_lock.c b/src/lib/eina/eina_lock.c
index 7f20d7cb18..40894f8035 100644
--- a/src/lib/eina/eina_lock.c
+++ b/src/lib/eina/eina_lock.c
@@ -302,4 +302,3 @@ eina_semaphore_release(Eina_Semaphore *sem, int count_release EINA_UNUSED)
302{ 302{
303 return _eina_semaphore_release(sem, count_release); 303 return _eina_semaphore_release(sem, count_release);
304} 304}
305
diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c
index 292c3d463d..252b7f6465 100644
--- a/src/lib/eina/eina_main.c
+++ b/src/lib/eina/eina_main.c
@@ -109,7 +109,7 @@ static int _mt_enabled = 0;
109 109
110#ifdef EFL_HAVE_THREADS 110#ifdef EFL_HAVE_THREADS
111EINA_API int _eina_threads_debug = 0; 111EINA_API int _eina_threads_debug = 0;
112EINA_API pthread_mutex_t _eina_tracking_lock; 112EINA_API Eina_Lock _eina_tracking_lock;
113EINA_API Eina_Inlist *_eina_tracking = NULL; 113EINA_API Eina_Inlist *_eina_tracking = NULL;
114extern Eina_Lock _sysmon_lock; 114extern Eina_Lock _sysmon_lock;
115#endif 115#endif