1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/thread_pthread.h
naruse b323b86b6b * thread_pthread.c (native_thread_init_stack): use get_stack.
patched by KOSAKI Motohiro [ruby-dev:40309]

* thread_pthread.c (ruby_init_stack): use get_stack
  on platforms which have pthread_attr_get_np.
  (FreeBSD, DragonFlyBSD and NetBSD)
  This is because FreeBSD and DragonFly BSD must use
  pthread_attr_get_np to get stack size of main thread,
  but Mac OS X and Linux with LinuxThreads must use getrlimit.
  <http://www.nminoru.jp/~nminoru/programming/stackoverflow_handling.html>
  <http://d.hatena.ne.jp/nurse/20100204>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-04 07:17:03 +00:00

27 lines
641 B
C

/**********************************************************************
thread_pthread.h -
$Author$
Copyright (C) 2004-2007 Koichi Sasada
**********************************************************************/
#ifndef RUBY_THREAD_PTHREAD_H
#define RUBY_THREAD_PTHREAD_H
#include <pthread.h>
#ifdef HAVE_PTHREAD_NP_H
#include <pthread_np.h>
#endif
typedef pthread_t rb_thread_id_t;
typedef pthread_mutex_t rb_thread_lock_t;
typedef pthread_cond_t rb_thread_cond_t;
typedef struct native_thread_data_struct {
void *signal_thread_list;
pthread_cond_t sleep_cond;
} native_thread_data_t;
#endif /* RUBY_THREAD_PTHREAD_H */