summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--configure.in5
-rw-r--r--ext/thread/extconf.rb2
-rw-r--r--lib/thread.rb4
4 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2681e056a1..acd4bb8be9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Feb 11 06:27:54 2007 Akinori MUSHA <knu@iDaemons.org>
+
+ * configure.in, ext/thread/extconf.rb, lib/thread.rb: Add a
+ configure option `--disable-fastthread', to choose the original,
+ pure ruby version of the "thread" library instead of the new,
+ much faster implementation in ext/thread.
+
Sun Feb 11 06:22:20 2007 Akinori MUSHA <knu@iDaemons.org>
* ext/Setup: Add thread except for platforms without threads
diff --git a/configure.in b/configure.in
index ea087c26f7..4c59fa488e 100644
--- a/configure.in
+++ b/configure.in
@@ -350,6 +350,11 @@ AC_ARG_ENABLE(pthread,
[ --enable-pthread use pthread library.],
[enable_pthread=$enableval], [enable_pthread=no])
+AC_ARG_ENABLE(fastthread,
+ [ --disable-fastthread do not use the fastthread mutex], [
+ : handled by ext/thread/extconf.rb
+ ])
+
dnl Checks for libraries.
case "$target_os" in
nextstep*) ;;
diff --git a/ext/thread/extconf.rb b/ext/thread/extconf.rb
index efe1d5dbe5..2f984efc6d 100644
--- a/ext/thread/extconf.rb
+++ b/ext/thread/extconf.rb
@@ -1,5 +1,7 @@
require 'mkmf'
+enable_config('fastthread', true) or exit
+
if with_config('mem-pools', true)
$CPPFLAGS << ' -DUSE_MEM_POOLS'
end
diff --git a/lib/thread.rb b/lib/thread.rb
index c4bb141ce7..7df6a140f5 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -1,4 +1,8 @@
#
+# NOTE:
+# This file is overwritten by ext/thread/lib/thread.rb unless ruby
+# is configured with --disable-fastthread.
+#
# thread.rb - thread support classes
# $Date$
# by Yukihiro Matsumoto <matz@netlab.co.jp>