[v4,28/41] pid: Add pid ns futex helper_created

Submitted by Kirill Tkhai on May 4, 2017, 4:09 p.m.

Details

Message ID 149391419200.11711.10027836827588535553.stgit@localhost.localdomain
State New
Series "Nested pid namespaces support"
Headers show

Commit Message

Kirill Tkhai May 4, 2017, 4:09 p.m.
This futex is need to notify waiter, that ns has created

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 criu/include/namespaces.h |    1 +
 criu/namespaces.c         |    1 +
 2 files changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/criu/include/namespaces.h b/criu/include/namespaces.h
index b126bed2c..37b65b0db 100644
--- a/criu/include/namespaces.h
+++ b/criu/include/namespaces.h
@@ -153,6 +153,7 @@  struct ns_id {
 		struct {
 			struct rb_root rb_root;
 			int nsfd_id;
+			futex_t helper_created;
 		} pid;
 	};
 };
diff --git a/criu/namespaces.c b/criu/namespaces.c
index 4dd2377fc..f07860582 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -313,6 +313,7 @@  struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid,
 		} else if (nd == &pid_ns_desc) {
 			nsid->pid.rb_root = RB_ROOT;
 			nsid->pid.nsfd_id = -1;
+			futex_init(&nsid->pid.helper_created);
 		}
 	}