fork.c (a0fa1dd3cdbccec9597fe53b6177a9aa6e20f2f8) | fork.c (0c740d0afc3bff0a097ad03a1c8df92757516f5c) |
---|---|
1/* 2 * linux/kernel/fork.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 */ 6 7/* 8 * 'fork.c' contains the help-routines for the 'fork' system call --- 1021 unchanged lines hidden (view full) --- 1030 sig = kmem_cache_zalloc(signal_cachep, GFP_KERNEL); 1031 tsk->signal = sig; 1032 if (!sig) 1033 return -ENOMEM; 1034 1035 sig->nr_threads = 1; 1036 atomic_set(&sig->live, 1); 1037 atomic_set(&sig->sigcnt, 1); | 1/* 2 * linux/kernel/fork.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 */ 6 7/* 8 * 'fork.c' contains the help-routines for the 'fork' system call --- 1021 unchanged lines hidden (view full) --- 1030 sig = kmem_cache_zalloc(signal_cachep, GFP_KERNEL); 1031 tsk->signal = sig; 1032 if (!sig) 1033 return -ENOMEM; 1034 1035 sig->nr_threads = 1; 1036 atomic_set(&sig->live, 1); 1037 atomic_set(&sig->sigcnt, 1); |
1038 1039 /* list_add(thread_node, thread_head) without INIT_LIST_HEAD() */ 1040 sig->thread_head = (struct list_head)LIST_HEAD_INIT(tsk->thread_node); 1041 tsk->thread_node = (struct list_head)LIST_HEAD_INIT(sig->thread_head); 1042 |
|
1038 init_waitqueue_head(&sig->wait_chldexit); 1039 sig->curr_target = tsk; 1040 init_sigpending(&sig->shared_pending); 1041 INIT_LIST_HEAD(&sig->posix_timers); 1042 1043 hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 1044 sig->real_timer.function = it_real_fn; 1045 --- 423 unchanged lines hidden (view full) --- 1469 attach_pid(p, PIDTYPE_SID); 1470 __this_cpu_inc(process_counts); 1471 } else { 1472 current->signal->nr_threads++; 1473 atomic_inc(¤t->signal->live); 1474 atomic_inc(¤t->signal->sigcnt); 1475 list_add_tail_rcu(&p->thread_group, 1476 &p->group_leader->thread_group); | 1043 init_waitqueue_head(&sig->wait_chldexit); 1044 sig->curr_target = tsk; 1045 init_sigpending(&sig->shared_pending); 1046 INIT_LIST_HEAD(&sig->posix_timers); 1047 1048 hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 1049 sig->real_timer.function = it_real_fn; 1050 --- 423 unchanged lines hidden (view full) --- 1474 attach_pid(p, PIDTYPE_SID); 1475 __this_cpu_inc(process_counts); 1476 } else { 1477 current->signal->nr_threads++; 1478 atomic_inc(¤t->signal->live); 1479 atomic_inc(¤t->signal->sigcnt); 1480 list_add_tail_rcu(&p->thread_group, 1481 &p->group_leader->thread_group); |
1482 list_add_tail_rcu(&p->thread_node, 1483 &p->signal->thread_head); |
|
1477 } 1478 attach_pid(p, PIDTYPE_PID); 1479 nr_threads++; 1480 } 1481 1482 total_forks++; 1483 spin_unlock(¤t->sighand->siglock); 1484 write_unlock_irq(&tasklist_lock); --- 450 unchanged lines hidden --- | 1484 } 1485 attach_pid(p, PIDTYPE_PID); 1486 nr_threads++; 1487 } 1488 1489 total_forks++; 1490 spin_unlock(¤t->sighand->siglock); 1491 write_unlock_irq(&tasklist_lock); --- 450 unchanged lines hidden --- |