Hi,
The following code fragment is from the funciton named create_thread()
which included in glibc 2.11.2:
int clone_flags = (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGNAL
| CLONE_SETTLS | CLONE_PARENT_SETTID
| CLONE_CHILD_CLEARTID | CLONE_SYSVSEM
#if __ASSUME_NO_CLONE_DETACHED == 0
| CLONE_DETACHED
#endif
| 0);
int res = do_clone (pd, attr, clone_flags, start_thread,
STACK_VARIABLES_ARGS, 1);
This means that when creating a thread by do_clone(), it is
unnecessary to include the CLONE_THREAD flag in the clone_flags
variable. AFAIK, a thread is added into a thread group only if the
CLONE_THREAD flag is specified when creating it. So, I wonder why the
CLONE_THREAD flag is not speified in calling do_clone() and in which
circumstances this flag play its role.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ