Module Name:    src
Committed By:   haad
Date:           Mon May 10 06:26:11 UTC 2010

Modified Files:
        src/external/cddl/osnet/include: thread.h

Log Message:
If thread_create was called with thread_id = NULL use our local thread id
as replacement otherwise we will crash.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/include/thread.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/include/thread.h
diff -u src/external/cddl/osnet/include/thread.h:1.2 src/external/cddl/osnet/include/thread.h:1.3
--- src/external/cddl/osnet/include/thread.h:1.2	Mon May  3 00:31:32 2010
+++ src/external/cddl/osnet/include/thread.h	Mon May 10 06:26:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: thread.h,v 1.2 2010/05/03 00:31:32 haad Exp $	*/
+/*	$NetBSD: thread.h,v 1.3 2010/05/10 06:26:11 haad Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -91,9 +91,16 @@
 	if(flags & THR_DETACHED)
 		pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
+	thread_t th_id;
+	thread_t *t_id;
+	if(new_thread_ID != NULL)
+		t_id = new_thread_ID;
+	else
+		t_id = &th_id;
+
 	/* This function ignores the THR_BOUND flag, since NPTL doesn't seem to support PTHREAD_SCOPE_PROCESS */
 
-	ret = pthread_create(new_thread_ID, &attr, start_func, arg);
+	ret = pthread_create(t_id, &attr, start_func, arg);
 
 	pthread_attr_destroy(&attr);
 

Reply via email to