mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-16 08:56:40 -05:00
add support for SCHED_FIFO
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@163 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
9618aea5df
commit
34fe8bd893
24 changed files with 181 additions and 49 deletions
|
|
@ -332,6 +332,7 @@ void pa_mainloop_free(struct pa_mainloop* m) {
|
|||
static void scan_dead(struct pa_mainloop *m) {
|
||||
int all = 0;
|
||||
assert(m);
|
||||
|
||||
if (m->io_events_scan_dead)
|
||||
pa_idxset_foreach(m->io_events, io_foreach, &all);
|
||||
if (m->time_events_scan_dead)
|
||||
|
|
@ -402,7 +403,7 @@ static void dispatch_defer(struct pa_mainloop *m) {
|
|||
for (e = pa_idxset_first(m->defer_events, &index); e; e = pa_idxset_next(m->defer_events, &index)) {
|
||||
if (e->dead || !e->enabled)
|
||||
continue;
|
||||
|
||||
|
||||
assert(e->callback);
|
||||
e->callback(&m->api, e, e->userdata);
|
||||
}
|
||||
|
|
@ -413,18 +414,23 @@ static int calc_next_timeout(struct pa_mainloop *m) {
|
|||
struct pa_time_event *e;
|
||||
struct timeval now;
|
||||
int t = -1;
|
||||
int got_time = 0;
|
||||
|
||||
if (pa_idxset_isempty(m->time_events))
|
||||
return -1;
|
||||
|
||||
gettimeofday(&now, NULL);
|
||||
|
||||
for (e = pa_idxset_first(m->time_events, &index); e; e = pa_idxset_next(m->time_events, &index)) {
|
||||
int tmp;
|
||||
|
||||
if (e->dead || !e->enabled)
|
||||
continue;
|
||||
|
||||
/* Let's save a system call */
|
||||
if (!got_time) {
|
||||
gettimeofday(&now, NULL);
|
||||
got_time = 1;
|
||||
}
|
||||
|
||||
if (e->timeval.tv_sec < now.tv_sec || (e->timeval.tv_sec == now.tv_sec && e->timeval.tv_usec <= now.tv_usec))
|
||||
return 0;
|
||||
|
||||
|
|
@ -448,17 +454,23 @@ static void dispatch_timeout(struct pa_mainloop *m) {
|
|||
uint32_t index;
|
||||
struct pa_time_event *e;
|
||||
struct timeval now;
|
||||
int got_time = 0;
|
||||
assert(m);
|
||||
|
||||
if (pa_idxset_isempty(m->time_events))
|
||||
return;
|
||||
|
||||
gettimeofday(&now, NULL);
|
||||
for (e = pa_idxset_first(m->time_events, &index); e; e = pa_idxset_next(m->time_events, &index)) {
|
||||
|
||||
if (e->dead || !e->enabled)
|
||||
continue;
|
||||
|
||||
/* Let's save a system call */
|
||||
if (!got_time) {
|
||||
gettimeofday(&now, NULL);
|
||||
got_time = 1;
|
||||
}
|
||||
|
||||
if (e->timeval.tv_sec < now.tv_sec || (e->timeval.tv_sec == now.tv_sec && e->timeval.tv_usec <= now.tv_usec)) {
|
||||
assert(e->callback);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue