[gnome-builder] plugins/podman: check-lock-check for atomic bit
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/podman: check-lock-check for atomic bit
- Date: Tue, 20 Sep 2022 22:01:24 +0000 (UTC)
commit 4aa0e4d34694e1a99169b9fe613cd43b6b129ba2
Author: Christian Hergert <chergert redhat com>
Date: Tue Sep 20 14:51:05 2022 -0700
plugins/podman: check-lock-check for atomic bit
src/plugins/podman/gbp-podman-runtime.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/podman/gbp-podman-runtime.c b/src/plugins/podman/gbp-podman-runtime.c
index 240213e13..aceaa7dd1 100644
--- a/src/plugins/podman/gbp-podman-runtime.c
+++ b/src/plugins/podman/gbp-podman-runtime.c
@@ -37,8 +37,9 @@ struct _GbpPodmanRuntime
JsonObject *object;
gchar *id;
GMutex mutex;
- guint has_started : 1;
GList *layers;
+
+ gboolean has_started;
};
G_DEFINE_FINAL_TYPE (GbpPodmanRuntime, gbp_podman_runtime, IDE_TYPE_RUNTIME)
@@ -57,6 +58,9 @@ maybe_start (GbpPodmanRuntime *self)
g_mutex_lock (&self->mutex);
+ if (g_atomic_int_get (&self->has_started))
+ goto unlock;
+
launcher = ide_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDERR_SILENCE |
G_SUBPROCESS_FLAGS_STDOUT_SILENCE);
ide_subprocess_launcher_set_run_on_host (launcher, TRUE);
@@ -70,6 +74,7 @@ maybe_start (GbpPodmanRuntime *self)
self->has_started = TRUE;
}
+unlock:
g_mutex_unlock (&self->mutex);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]