[PATCH 2/5] mainloop: Remove useless pa_mainloop_wakeup() calls.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



pa_mainloop_wakeup() is only useful for waking up the
mainloop from another thread. The removed calls were in
functions that can not be safely called from other threads,
so calling pa_mainloop_wakeup() didn't make sense.
---
 src/pulse/mainloop.c |   17 +----------------
 1 files changed, 1 insertions(+), 16 deletions(-)

diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index 262e4b3..53ff7af 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -197,8 +197,6 @@ static pa_io_event* mainloop_io_new(
     m->rebuild_pollfds = TRUE;
     m->n_io_events ++;
 
-    pa_mainloop_wakeup(m);
-
     return e;
 }
 
@@ -215,8 +213,6 @@ static void mainloop_io_enable(pa_io_event *e, pa_io_event_flags_t events) {
         e->pollfd->events = map_flags_to_libc(events);
     else
         e->mainloop->rebuild_pollfds = TRUE;
-
-    pa_mainloop_wakeup(e->mainloop);
 }
 
 static void mainloop_io_free(pa_io_event *e) {
@@ -228,8 +224,6 @@ static void mainloop_io_free(pa_io_event *e) {
 
     e->mainloop->n_io_events --;
     e->mainloop->rebuild_pollfds = TRUE;
-
-    pa_mainloop_wakeup(e->mainloop);
 }
 
 static void mainloop_io_set_destroy(pa_io_event *e, pa_io_event_destroy_cb_t callback) {
@@ -265,8 +259,6 @@ static pa_defer_event* mainloop_defer_new(
 
     PA_LLIST_PREPEND(pa_defer_event, m->defer_events, e);
 
-    pa_mainloop_wakeup(e->mainloop);
-
     return e;
 }
 
@@ -277,10 +269,8 @@ static void mainloop_defer_enable(pa_defer_event *e, int b) {
     if (e->enabled && !b) {
         pa_assert(e->mainloop->n_enabled_defer_events > 0);
         e->mainloop->n_enabled_defer_events--;
-    } else if (!e->enabled && b) {
+    } else if (!e->enabled && b)
         e->mainloop->n_enabled_defer_events++;
-        pa_mainloop_wakeup(e->mainloop);
-    }
 
     e->enabled = b;
 }
@@ -368,9 +358,6 @@ static pa_time_event* mainloop_time_new(
 
     PA_LLIST_PREPEND(pa_time_event, m->time_events, e);
 
-    if (e->enabled)
-        pa_mainloop_wakeup(m);
-
     return e;
 }
 
@@ -394,7 +381,6 @@ static void mainloop_time_restart(pa_time_event *e, const struct timeval *tv) {
     if ((e->enabled = valid)) {
         e->time = t;
         e->use_rtclock = use_rtclock;
-        pa_mainloop_wakeup(e->mainloop);
     }
 
     if (e->mainloop->cached_next_time_event && e->enabled) {
@@ -985,7 +971,6 @@ void pa_mainloop_quit(pa_mainloop *m, int retval) {
 
     m->quit = TRUE;
     m->retval = retval;
-    pa_mainloop_wakeup(m);
 }
 
 pa_mainloop_api* pa_mainloop_get_api(pa_mainloop *m) {
-- 
1.7.8



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux