svn commit: r191833 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern

Andriy Gapon avg at FreeBSD.org
Tue May 5 18:02:09 UTC 2009


Author: avg
Date: Tue May  5 18:02:07 2009
New Revision: 191833
URL: http://svn.freebsd.org/changeset/base/191833

Log:
  MFC r174848 by julian: give thread0 the tid 100000
  
  ... and bumpt the others to start at 100001.
  This is convenient for ACPI code that needs a thread id that is
  never zero.
  
  Reviewed by:	jkim
  Approved by:	jhb (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/init_main.c
  stable/7/sys/kern/kern_thread.c

Modified: stable/7/sys/kern/init_main.c
==============================================================================
--- stable/7/sys/kern/init_main.c	Tue May  5 17:22:48 2009	(r191832)
+++ stable/7/sys/kern/init_main.c	Tue May  5 18:02:07 2009	(r191833)
@@ -425,6 +425,7 @@ proc0_init(void *dummy __unused)
 	knlist_init(&p->p_klist, &p->p_mtx, NULL, NULL, NULL);
 	STAILQ_INIT(&p->p_ktr);
 	p->p_nice = NZERO;
+	td->td_tid = PID_MAX + 1;
 	td->td_state = TDS_RUNNING;
 	td->td_pri_class = PRI_TIMESHARE;
 	td->td_user_pri = PUSER;

Modified: stable/7/sys/kern/kern_thread.c
==============================================================================
--- stable/7/sys/kern/kern_thread.c	Tue May  5 17:22:48 2009	(r191832)
+++ stable/7/sys/kern/kern_thread.c	Tue May  5 18:02:07 2009	(r191833)
@@ -252,7 +252,8 @@ threadinit(void)
 {
 
 	mtx_init(&tid_lock, "TID lock", NULL, MTX_DEF);
-	tid_unrhdr = new_unrhdr(PID_MAX + 1, INT_MAX, &tid_lock);
+	/* leave one number for thread0 */
+	tid_unrhdr = new_unrhdr(PID_MAX + 2, INT_MAX, &tid_lock);
 
 	thread_zone = uma_zcreate("THREAD", sched_sizeof_thread(),
 	    thread_ctor, thread_dtor, thread_init, thread_fini,


More information about the svn-src-stable-7 mailing list