summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-02 14:28:35 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-07-03 16:10:23 +0200
commit7c50209baa837645ce1f143d3678a6089bc2e810 (patch)
treed3c4f2ff08d7e64bdca127c79e85305aa5663a7c /src/lib/eina
parente7e1560e18228905d19e9a34b256fa1a8beb6347 (diff)
eina/debug: remove global lock for session list access
this list is now only accessed from the main thread so there's no reason to have a lock for it
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_debug.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/lib/eina/eina_debug.c b/src/lib/eina/eina_debug.c
index dbce08d04a..4d70454d0a 100644
--- a/src/lib/eina/eina_debug.c
+++ b/src/lib/eina/eina_debug.c
@@ -107,7 +107,6 @@ extern Eina_Bool eina_mempool_init(void);
107extern Eina_Bool eina_list_init(void); 107extern Eina_Bool eina_list_init(void);
108 108
109extern Eina_Spinlock _eina_debug_thread_lock; 109extern Eina_Spinlock _eina_debug_thread_lock;
110static Eina_Spinlock _thread_delete_lock;
111static Eina_List *sessions; 110static Eina_List *sessions;
112 111
113static Eina_Bool _debug_disabled = EINA_FALSE; 112static Eina_Bool _debug_disabled = EINA_FALSE;
@@ -465,9 +464,7 @@ _session_create(int fd)
465 session->dispatch_cb = eina_debug_dispatch; 464 session->dispatch_cb = eina_debug_dispatch;
466 session->fd = fd; 465 session->fd = fd;
467 eina_lock_new(&session->lock); 466 eina_lock_new(&session->lock);
468 eina_spinlock_take(&_thread_delete_lock);
469 sessions = eina_list_append(sessions, session); 467 sessions = eina_list_append(sessions, session);
470 eina_spinlock_release(&_thread_delete_lock);
471 // start the monitor thread 468 // start the monitor thread
472 _thread_start(session); 469 _thread_start(session);
473 return session; 470 return session;
@@ -721,7 +718,6 @@ eina_debug_init(void)
721 // set up thread things 718 // set up thread things
722 eina_spinlock_new(&_eina_debug_lock); 719 eina_spinlock_new(&_eina_debug_lock);
723 eina_spinlock_new(&_eina_debug_thread_lock); 720 eina_spinlock_new(&_eina_debug_thread_lock);
724 eina_spinlock_new(&_thread_delete_lock);
725 self = pthread_self(); 721 self = pthread_self();
726 _eina_debug_thread_mainloop_set(&self); 722 _eina_debug_thread_mainloop_set(&self);
727 _eina_debug_thread_add(&self); 723 _eina_debug_thread_add(&self);
@@ -748,10 +744,8 @@ eina_debug_shutdown(void)
748 Eina_Debug_Session *session; 744 Eina_Debug_Session *session;
749 pthread_t self = pthread_self(); 745 pthread_t self = pthread_self();
750 746
751 eina_spinlock_take(&_thread_delete_lock);
752 EINA_LIST_FREE(sessions, session) 747 EINA_LIST_FREE(sessions, session)
753 eina_debug_session_terminate(session); 748 eina_debug_session_terminate(session);
754 eina_spinlock_release(&_thread_delete_lock);
755 749
756 _eina_debug_timer_shutdown(); 750 _eina_debug_timer_shutdown();
757 _eina_debug_bt_shutdown(); 751 _eina_debug_bt_shutdown();
@@ -759,7 +753,6 @@ eina_debug_shutdown(void)
759 _eina_debug_thread_del(&self); 753 _eina_debug_thread_del(&self);
760 eina_spinlock_free(&_eina_debug_lock); 754 eina_spinlock_free(&_eina_debug_lock);
761 eina_spinlock_free(&_eina_debug_thread_lock); 755 eina_spinlock_free(&_eina_debug_thread_lock);
762 eina_spinlock_free(&_thread_delete_lock);
763 eina_threads_shutdown(); 756 eina_threads_shutdown();
764 return EINA_TRUE; 757 return EINA_TRUE;
765} 758}