]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
- Move sched_fork() later in fork() after the various sections of the new
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 6 Jan 2011 22:24:00 +0000 (22:24 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 6 Jan 2011 22:24:00 +0000 (22:24 +0000)
commit22d19207e9830cc42b89f2e36aef61a1eea835be
tree61f6474d4e7ec8034e7d80fbded69ce4f81a66d7
parent177499ebcc0aa354bbf8e560921833129027e1a9
- Move sched_fork() later in fork() after the various sections of the new
  thread and proc have been copied and zeroed from the old thread and
  proc.  Otherwise attempts to modify thread or process data in sched_fork()
  could be undone.
- Don't copy td_{base,}_user_pri from the old thread to the new thread in
  sched_fork_thread() in ULE.  This is already done courtesy the bcopy()
  of the thread copy region.
- Always initialize the real priority (td_priority) of new threads to the
  new thread's base priority (td_base_pri) to avoid bogusly inheriting a
  borrowed priority from the parent thread.

MFC after: 2 weeks
sys/kern/kern_fork.c
sys/kern/sched_4bsd.c
sys/kern/sched_ule.c