mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-30 11:08:50 -05:00
make pa_asyncq_push() fail under no circumstances.
This commit is contained in:
parent
587a08bae4
commit
20edd846d0
1 changed files with 7 additions and 6 deletions
|
|
@ -163,14 +163,14 @@ static int push(pa_asyncq*l, void *p, pa_bool_t wait) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static pa_bool_t flush_postq(pa_asyncq *l) {
|
static pa_bool_t flush_postq(pa_asyncq *l, pa_bool_t wait) {
|
||||||
struct localq *q;
|
struct localq *q;
|
||||||
|
|
||||||
pa_assert(l);
|
pa_assert(l);
|
||||||
|
|
||||||
while ((q = l->last_localq)) {
|
while ((q = l->last_localq)) {
|
||||||
|
|
||||||
if (push(l, q->data, FALSE) < 0)
|
if (push(l, q->data, wait) < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
l->last_localq = q->prev;
|
l->last_localq = q->prev;
|
||||||
|
|
@ -187,7 +187,7 @@ static pa_bool_t flush_postq(pa_asyncq *l) {
|
||||||
int pa_asyncq_push(pa_asyncq*l, void *p, pa_bool_t wait) {
|
int pa_asyncq_push(pa_asyncq*l, void *p, pa_bool_t wait) {
|
||||||
pa_assert(l);
|
pa_assert(l);
|
||||||
|
|
||||||
if (!flush_postq(l))
|
if (!flush_postq(l, wait))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return push(l, p, wait);
|
return push(l, p, wait);
|
||||||
|
|
@ -199,8 +199,9 @@ void pa_asyncq_post(pa_asyncq*l, void *p) {
|
||||||
pa_assert(l);
|
pa_assert(l);
|
||||||
pa_assert(p);
|
pa_assert(p);
|
||||||
|
|
||||||
if (pa_asyncq_push(l, p, FALSE) >= 0)
|
if (flush_postq(l, FALSE))
|
||||||
return;
|
if (pa_asyncq_push(l, p, FALSE) >= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
/* OK, we couldn't push anything in the queue. So let's queue it
|
/* OK, we couldn't push anything in the queue. So let's queue it
|
||||||
* locally and push it later */
|
* locally and push it later */
|
||||||
|
|
@ -299,7 +300,7 @@ void pa_asyncq_write_before_poll(pa_asyncq *l) {
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
||||||
if (flush_postq(l))
|
if (flush_postq(l, FALSE))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (pa_fdsem_before_poll(l->read_fdsem) >= 0) {
|
if (pa_fdsem_before_poll(l->read_fdsem) >= 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue