[CRIU] [PATCH 22/24] parasite: remove PARASITE_CMD_DAEMONIZED and s->ack

Andrey Vagin avagin at openvz.org
Wed May 22 16:08:23 EDT 2013


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/lock.h     | 4 ++++
 include/parasite.h | 1 -
 pie/parasite.c     | 5 +----
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/lock.h b/include/lock.h
index fec5380..d736e90 100644
--- a/include/lock.h
+++ b/include/lock.h
@@ -95,6 +95,10 @@ static inline void futex_wait_while_gt(futex_t *f, u32 v)
 static inline void futex_wait_while_lt(futex_t *f, u32 v)
 { futex_wait_if_cond(f, v, >=); }
 
+/* Wait while futex @f value is equal to @v */
+static inline void futex_wait_while_eq(futex_t *f, u32 v)
+{ futex_wait_if_cond(f, v, !=); }
+
 /* Wait while futex @f value is @v */
 static inline void futex_wait_while(futex_t *f, u32 v)
 {
diff --git a/include/parasite.h b/include/parasite.h
index cc5574f..b673531 100644
--- a/include/parasite.h
+++ b/include/parasite.h
@@ -28,7 +28,6 @@ enum {
 	 * These two must be greater than INITs.
 	 */
 	PARASITE_CMD_DAEMONIZE,
-	PARASITE_CMD_DAEMONIZED,
 
 	PARASITE_CMD_CFG_LOG,
 	PARASITE_CMD_FINI,
diff --git a/pie/parasite.c b/pie/parasite.c
index 762d863..4717b7e 100644
--- a/pie/parasite.c
+++ b/pie/parasite.c
@@ -24,7 +24,6 @@ static struct tid_state_s {
 	pid_t		tid;
 
 	futex_t		cmd;
-	futex_t		ack;
 	int		ret;
 
 	bool		use_sig_blocked;
@@ -251,7 +250,6 @@ static int init_thread(struct parasite_init_args *args)
 	tid_state[next_tid_state].sigframe = args->sigframe;
 
 	futex_set(&tid_state[next_tid_state].cmd, PARASITE_CMD_IDLE);
-	futex_set(&tid_state[next_tid_state].ack, PARASITE_CMD_IDLE);
 
 	hash_thread_state(&tid_state[next_tid_state]);
 
@@ -486,14 +484,13 @@ static int __parasite_daemon_wait_msg(struct ctl_msg *m)
 
 static int __parasite_daemon_thread_wait_cmd(struct tid_state_s *s)
 {
-	futex_wait_while_lt(&s->cmd, PARASITE_CMD_DAEMONIZED);
+	futex_wait_while_eq(&s->cmd, PARASITE_CMD_IDLE);
 	return futex_get(&s->cmd);
 }
 
 static void __parasite_daemon_thread_ack(struct tid_state_s *s, int ret)
 {
 	s->ret = ret;
-	futex_set(&s->ack, PARASITE_CMD_IDLE);
 	futex_set_and_wake(&s->cmd, PARASITE_CMD_IDLE);
 }
 
-- 
1.8.2



More information about the CRIU mailing list