* thread_pthread.c: DragonFlyBSD is also the same as FreeBSD
on getting the stack size of the main thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fb15c0f16c
commit
44b5a74a9a
@ -1,3 +1,8 @@
|
|||||||
|
Wed Feb 3 13:15:24 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Wed Feb 3 12:30:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* thread_pthread.c (ruby_init_stack): use pthread_get_attr_np
|
* thread_pthread.c (ruby_init_stack): use pthread_get_attr_np
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#ifdef THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
|
#ifdef THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
|
||||||
|
|
||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
#ifdef __FreeBSD__
|
#if defined(__FreeBSD__) || defined(__DragonFly)
|
||||||
#include <pthread_np.h>
|
#include <pthread_np.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -297,10 +297,10 @@ ruby_init_stack(volatile VALUE *addr
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
size_t size = 0, space = 0;
|
size_t size = 0, space = 0;
|
||||||
#ifdef __FreeBSD__
|
#if defined(__FreeBSD__) || defined(__DragonFly)
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
if (pthread_attr_init(&attr) == 0) {
|
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_getstacksize(&attr, &size);
|
||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user