[前][次][番号順一覧][スレッド一覧]

ruby-changes:14696

From: naruse <ko1@a...>
Date: Wed, 3 Feb 2010 13:17:35 +0900 (JST)
Subject: [ruby-changes:14696] Ruby:r26550 (trunk): * thread_pthread.c: DragonFlyBSD is also the same as FreeBSD

naruse	2010-02-03 13:17:19 +0900 (Wed, 03 Feb 2010)

  New Revision: 26550

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26550

  Log:
    * thread_pthread.c: DragonFlyBSD is also the same as FreeBSD
      on getting the stack size of the main thread.

  Modified files:
    trunk/ChangeLog
    trunk/thread_pthread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26549)
+++ ChangeLog	(revision 26550)
@@ -1,3 +1,8 @@
+Wed Feb  3 13:15:24 2010  NARUSE, Yui  <naruse@r...>
+
+	* thread_pthread.c: DragonFlyBSD is also the same as FreeBSD
+	  on getting the stack size of the main thread.
+
 Wed Feb  3 12:30:10 2010  NARUSE, Yui  <naruse@r...>
 
 	* thread_pthread.c (ruby_init_stack): use pthread_get_attr_np
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 26549)
+++ thread_pthread.c	(revision 26550)
@@ -12,7 +12,7 @@
 #ifdef THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
 
 #include "gc.h"
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly)
 #include <pthread_np.h>
 #endif
 
@@ -297,10 +297,10 @@
 #endif
     {
 	size_t size = 0, space = 0;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly)
 	pthread_attr_t attr;
 	if (pthread_attr_init(&attr) == 0) {
-	    pthread_attr_get_np(native_main_thread.id, &attr) ||
+	    if (pthread_attr_get_np(native_main_thread.id, &attr) == 0)
 		pthread_attr_getstacksize(&attr, &size);
 	    pthread_attr_destroy(&attr);
 	}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]