summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/rtpoll.c7
-rw-r--r--src/pulsecore/rtpoll.h5
2 files changed, 9 insertions, 3 deletions
diff --git a/src/pulsecore/rtpoll.c b/src/pulsecore/rtpoll.c
index e43ec610..be1c83c0 100644
--- a/src/pulsecore/rtpoll.c
+++ b/src/pulsecore/rtpoll.c
@@ -257,7 +257,7 @@ void pa_rtpoll_free(pa_rtpoll *p) {
pa_xfree(p);
}
-int pa_rtpoll_run(pa_rtpoll *p) {
+int pa_rtpoll_run(pa_rtpoll *p, int wait) {
pa_rtpoll_item *i;
int r = 0;
int no_events = 0;
@@ -301,7 +301,10 @@ int pa_rtpoll_run(pa_rtpoll *p) {
rtpoll_rebuild(p);
/* Calculate timeout */
- if (p->timer_enabled) {
+ if (!wait) {
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 0;
+ } else if (p->timer_enabled) {
struct timespec now;
pa_rtclock_get(&now);
diff --git a/src/pulsecore/rtpoll.h b/src/pulsecore/rtpoll.h
index 7fe5cb37..f393f918 100644
--- a/src/pulsecore/rtpoll.h
+++ b/src/pulsecore/rtpoll.h
@@ -58,7 +58,10 @@ void pa_rtpoll_free(pa_rtpoll *p);
void pa_rtpoll_install(pa_rtpoll *p);
-int pa_rtpoll_run(pa_rtpoll *f);
+/* Sleep on the rtpoll until the time event, or any of the fd events
+ * is triggered. If "wait" is 0 we don't sleep but only update the
+ * struct pollfd. */
+int pa_rtpoll_run(pa_rtpoll *f, int wait);
void pa_rtpoll_set_timer_absolute(pa_rtpoll *p, const struct timespec *ts);
void pa_rtpoll_set_timer_periodic(pa_rtpoll *p, pa_usec_t usec);