summaryrefslogtreecommitdiff
path: root/src/common/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/events.c')
-rw-r--r--src/common/events.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/events.c b/src/common/events.c
index 83baf11..c310f06 100644
--- a/src/common/events.c
+++ b/src/common/events.c
@@ -71,6 +71,15 @@ int yasl_private_events_error(struct yasl_private_display *d)
return error;
}
+bool yasl_private_events_failed(struct yasl_private_display *d)
+{
+ if (!d->events) return false;
+ yasl_private_mutex_lock(&d->events->mutex);
+ bool failed = d->events->error != 0;
+ yasl_private_mutex_unlock(&d->events->mutex);
+ return failed;
+}
+
bool yasl_private_events_pending(struct yasl_private_display *d)
{
if (!d->events) return false;
@@ -207,6 +216,8 @@ failed:
yasl_private_mutex_lock(&d->events->mutex);
d->events->error = ENOMEM;
yasl_private_mutex_unlock(&d->events->mutex);
+ /* The loss is an event too; the owner reports it in its next step. */
+ yasl_private_loop_wake(d->loop);
errno = ENOMEM;
return false;
}