From cf18f2725d65de93721f943b317d514f15ee42c4 Mon Sep 17 00:00:00 2001 From: nagai Date: Wed, 2 Mar 2005 08:11:28 +0000 Subject: * eval.c (ruby_native_thread_kill): call pthread_kill() to send a signal to ruby's native thread * ruby.h: add definition of ruby_native_thread_kill() * signal.c (sigsend_to_ruby_thread): send the signal to ruby's native thread ([ruby-dev:25744], [ruby-dev:25754]), and set signal mask to the current native thread git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ruby.h') diff --git a/ruby.h b/ruby.h index ed3c3a159..a5ae0636f 100644 --- a/ruby.h +++ b/ruby.h @@ -694,6 +694,9 @@ typedef pthread_t rb_nativethread_t; # define NATIVETHREAD_CURRENT() pthread_self() # define NATIVETHREAD_EQUAL(t1,t2) pthread_equal((t1),(t2)) # define HAVE_NATIVETHREAD + +# define NATIVETHREAD_KILL(th,sig) pthread_kill((th),(sig)) +# define HAVE_NATIVETHREAD_KILL #elif defined(_WIN32) || defined(_WIN32_WCE) typedef DWORD rb_nativethread_t; # define NATIVETHREAD_CURRENT() GetCurrentThreadId() @@ -701,10 +704,13 @@ typedef DWORD rb_nativethread_t; # define HAVE_NATIVETHREAD #endif #ifdef HAVE_NATIVETHREAD -RUBY_EXTERN int is_ruby_native_thread(); +int is_ruby_native_thread _((void)); #else #define is_ruby_native_thread() (1) #endif +#ifdef HAVE_NATIVETHREAD_KILL +void ruby_native_thread_kill _((int)); +#endif #if defined(__cplusplus) } /* extern "C" { */ -- cgit