* check existence of "pthread.h"
* define is_ruby_native_thread() macro when not HAVE_NATIVETHREAD git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b31aeea632
commit
c5061b6116
@ -1,3 +1,12 @@
|
|||||||
|
Fri Nov 21 01:40:00 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
|
* configure.in: check <pthread.h>
|
||||||
|
|
||||||
|
* ruby.h: include pthread.h if existence.
|
||||||
|
define is_ruby_native() macro when not HAVE_NATIVETHREAD
|
||||||
|
|
||||||
|
* eval.c: undef is_ruby_native() function when not HAVE_NATIVETHREAD
|
||||||
|
|
||||||
Thu Nov 21 00:43:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
|
Thu Nov 21 00:43:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
|
||||||
|
|
||||||
* lib/test/unit/assertions.rb: use #__send__ instead of #send.
|
* lib/test/unit/assertions.rb: use #__send__ instead of #send.
|
||||||
|
@ -350,7 +350,7 @@ AC_HEADER_SYS_WAIT
|
|||||||
AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h\
|
AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h\
|
||||||
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
|
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
|
||||||
syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
|
syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
|
||||||
sys/mkdev.h sys/utime.h float.h)
|
sys/mkdev.h sys/utime.h float.h pthread.h)
|
||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_TYPE_UID_T
|
AC_TYPE_UID_T
|
||||||
|
7
eval.c
7
eval.c
@ -1159,16 +1159,11 @@ void Init_ext _((void));
|
|||||||
|
|
||||||
#ifdef HAVE_NATIVETHREAD
|
#ifdef HAVE_NATIVETHREAD
|
||||||
static rb_nativethread_t ruby_thid;
|
static rb_nativethread_t ruby_thid;
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
int
|
||||||
is_ruby_native_thread() {
|
is_ruby_native_thread() {
|
||||||
#ifdef HAVE_NATIVETHREAD
|
|
||||||
return NATIVETHREAD_EQUAL(ruby_thid, NATIVETHREAD_CURRENT());
|
return NATIVETHREAD_EQUAL(ruby_thid, NATIVETHREAD_CURRENT());
|
||||||
#else
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
ruby_init()
|
ruby_init()
|
||||||
|
7
ruby.h
7
ruby.h
@ -672,6 +672,9 @@ static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_LIBPTHREAD)
|
#if defined(HAVE_LIBPTHREAD)
|
||||||
|
#ifdef HAVE_PTHREAD_H
|
||||||
|
#include <pthread.h>
|
||||||
|
#endif
|
||||||
typedef pthread_t rb_nativethread_t;
|
typedef pthread_t rb_nativethread_t;
|
||||||
# define NATIVETHREAD_CURRENT() pthread_self()
|
# define NATIVETHREAD_CURRENT() pthread_self()
|
||||||
# define NATIVETHREAD_EQUAL(t1,t2) pthread_equal((t1),(t2))
|
# define NATIVETHREAD_EQUAL(t1,t2) pthread_equal((t1),(t2))
|
||||||
@ -682,7 +685,11 @@ typedef DWORD rb_nativethread_t;
|
|||||||
# define NATIVETHREAD_EQUAL(t1,t2) ((t1) == (t2))
|
# define NATIVETHREAD_EQUAL(t1,t2) ((t1) == (t2))
|
||||||
# define HAVE_NATIVETHREAD
|
# define HAVE_NATIVETHREAD
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NATIVETHREAD
|
||||||
RUBY_EXTERN int is_ruby_native_thread();
|
RUBY_EXTERN int is_ruby_native_thread();
|
||||||
|
#else
|
||||||
|
#define is_ruby_native_thread() (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
} /* extern "C" { */
|
} /* extern "C" { */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user