From 340a511fdf6571a1f4adfc254a07edc5605f46e4 Mon Sep 17 00:00:00 2001 From: nagai Date: Thu, 20 Nov 2003 03:50:32 +0000 Subject: * configure.in: always check existence of the pthread library * ruby.h: define macros for ruby's native thread check * eval.c: add ruby's native thread check * gc.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ruby.h') diff --git a/ruby.h b/ruby.h index 0bd05b5c3d..7bac5db499 100644 --- a/ruby.h +++ b/ruby.h @@ -671,6 +671,21 @@ rb_special_const_p(obj) static char *dln_libs_to_be_linked[] = { EXTLIB, 0 }; #endif +#if defined(HAVE_LIBPTHREAD) +typedef pthread_t rb_nativethread_t; +# define NATIVETHREAD_CURRENT() pthread_self() +# define NATIVETHREAD_EQUAL(t1,t2) pthread_equal((t1),(t2)) +# define HAVE_NATIVETHREAD +#elif defined(_WIN32) || defined(_WIN32_WCE) || defined(__CYGWIN__) +typedef DWORD rb_nativethread_t; +# define NATIVETHREAD_CURRENT() GetCurrentThreadId() +# define NATIVETHREAD_EQUAL(t1,t2) ((t1) == (t2)) +# define HAVE_NATIVETHREAD +#endif +#ifdef HAVE_NATIVETHREAD +RUBY_EXTERN int is_ruby_native_thread(); +#endif + #if defined(__cplusplus) } /* extern "C" { */ #endif -- cgit v1.2.3