Module Name: src
Committed By: snj
Date: Thu May 20 05:02:07 UTC 2010
Modified Files:
src/lib/libpthread [netbsd-5]: pthread.c
Log Message:
Pull up following revision(s) (requested by explorer in ticket #1353):
lib/libpthread/pthread.c: revision 1.114, 1.115
Correctly set pt_lid in the child, after a fork
--
fix the pthread pt_lid in the fork callback function that runs in the
child instead of a function that may be going away. KNFify
To generate a diff of this commit:
cvs rdiff -u -r1.106.2.2 -r1.106.2.3 src/lib/libpthread/pthread.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.106.2.2 src/lib/libpthread/pthread.c:1.106.2.3
--- src/lib/libpthread/pthread.c:1.106.2.2 Mon Jan 11 00:47:29 2010
+++ src/lib/libpthread/pthread.c Thu May 20 05:02:07 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread.c,v 1.106.2.2 2010/01/11 00:47:29 snj Exp $ */
+/* $NetBSD: pthread.c,v 1.106.2.3 2010/05/20 05:02:07 snj Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread.c,v 1.106.2.2 2010/01/11 00:47:29 snj Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.106.2.3 2010/05/20 05:02:07 snj Exp $");
#define __EXPOSE_STACK 1
@@ -240,11 +240,14 @@
static void
pthread__fork_callback(void)
{
+ struct __pthread_st *self;
/* lwpctl state is not copied across fork. */
if (_lwp_ctl(LWPCTL_FEATURE_CURCPU, &pthread__first->pt_lwpctl)) {
err(1, "_lwp_ctl");
}
+ self = pthread__self();
+ self->pt_lid = _lwp_self();
}
static void