Browse Source

[LibOS] Omit field thread.dummy if ALIAS_VFORK_AS_FORK is defined

Isaku Yamahata 5 years ago
parent
commit
12e9eb0c63
2 changed files with 4 additions and 0 deletions
  1. 2 0
      LibOS/shim/include/shim_thread.h
  2. 2 0
      LibOS/shim/src/bookkeep/shim_thread.c

+ 2 - 0
LibOS/shim/include/shim_thread.h

@@ -37,8 +37,10 @@ struct shim_thread {
     struct shim_thread * parent;
     /* thread leader */
     struct shim_thread * leader;
+#ifndef ALIAS_VFORK_AS_FORK
     /* dummy thread: stores blocked parent thread for vfork */
     struct shim_thread * dummy;
+#endif
     /* child handles; protected by thread->lock */
     LISTP_TYPE(shim_thread) children;
     /* nodes in child handles; protected by the parent's lock */

+ 2 - 0
LibOS/shim/src/bookkeep/shim_thread.c

@@ -621,7 +621,9 @@ BEGIN_CP_FUNC(thread)
 
         new_thread->in_vm  = false;
         new_thread->parent = NULL;
+#ifndef ALIAS_VFORK_AS_FORK
         new_thread->dummy  = NULL;
+#endif
         new_thread->handle_map = NULL;
         new_thread->root   = NULL;
         new_thread->cwd    = NULL;