summaryrefslogtreecommitdiff
path: root/ruby.h
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-20 03:50:32 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-20 03:50:32 +0000
commit340a511fdf6571a1f4adfc254a07edc5605f46e4 (patch)
tree0bceac7407eab6b80f3f77cd0ec1c48a7fc2521d /ruby.h
parent531022ace399a527c5735c2caf41921b4ba7afe7 (diff)
* 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
Diffstat (limited to 'ruby.h')
-rw-r--r--ruby.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ruby.h b/ruby.h
index 0bd05b5..7bac5db 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