Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 2009 18:02:07 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r191833 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern
Message-ID:  <200905051802.n45I27T1089303@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905051802.n45I27T1089303>