[gnome-builder] subprocess: add exited signal to supervisor
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] subprocess: add exited signal to supervisor
- Date: Tue, 24 Apr 2018 06:24:04 +0000 (UTC)
commit 24a3243c7c1d48829d3c359bf50823b7aa9a1228
Author: Christian Hergert <chergert redhat com>
Date: Mon Apr 23 16:52:41 2018 -0700
subprocess: add exited signal to supervisor
This simplifies the process of tracking if we can write to a given pipe.
src/libide/subprocess/ide-subprocess-supervisor.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/src/libide/subprocess/ide-subprocess-supervisor.c
b/src/libide/subprocess/ide-subprocess-supervisor.c
index 42a4f2e03..7856a5e14 100644
--- a/src/libide/subprocess/ide-subprocess-supervisor.c
+++ b/src/libide/subprocess/ide-subprocess-supervisor.c
@@ -46,6 +46,7 @@ enum {
SPAWNED,
SUPERVISE,
UNSUPERVISE,
+ EXITED,
N_SIGNALS
};
@@ -159,6 +160,14 @@ ide_subprocess_supervisor_class_init (IdeSubprocessSupervisorClass *klass)
g_signal_accumulator_true_handled, NULL,
NULL,
G_TYPE_BOOLEAN, 1, IDE_TYPE_SUBPROCESS_LAUNCHER);
+
+ signals [EXITED] =
+ g_signal_new_class_handler ("exited",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ NULL, NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1, IDE_TYPE_SUBPROCESS);
}
static void
@@ -342,6 +351,8 @@ ide_subprocess_supervisor_wait_cb (GObject *object,
if (!ide_subprocess_wait_finish (subprocess, result, &error))
g_warning ("%s", error->message);
+ g_signal_emit (self, signals [EXITED], 0, subprocess);
+
#ifdef IDE_ENABLE_TRACE
{
if (ide_subprocess_get_if_exited (subprocess))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]