Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ruby 1.8.5 compatibility: "undefined symbol: rb_thread_alive_p". Rest…

…ores pre-1.0.2 (c3aabee) behaviour for pre-1.9 Ruby versions.

BEFORE:

~/devel/fastthread [git:master@c2f3537]> ~/.multiruby/install/v1_8_5/bin/ruby -v -S rake test
ruby 1.8.5 (2006-08-25) [x86_64-linux]
gcc -I. -I/home/jw/.multiruby/install/v1_8_5/lib/ruby/1.8/x86_64-linux -I/home/jw/.multiruby/install/v1_8_5/lib/ruby/1.8/x86_64-linux -I.  -fPIC -g -O2  -c fastthread.c
gcc -shared  -L'/home/jw/.multiruby/install/v1_8_5/lib' -Wl,-R'/home/jw/.multiruby/install/v1_8_5/lib' -o fastthread.so fastthread.o  -ldl -lcrypt -lm -lc
/home/jw/.multiruby/install/v1_8_5/bin/ruby -I"/local/data/jw/devel/fastthread/lib" -I"/local/data/jw/devel/fastthread/ext" -I"/local/data/jw/devel/fastthread/bin" -I"/local/data/jw/devel/fastthread/test" "/home/jw/.multiruby/install/v1_8_5/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/test_all.rb"
Loaded suite /home/jw/.multiruby/install/v1_8_5/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader
Started
/home/jw/.multiruby/install/v1_8_5/bin/ruby: symbol lookup error: /local/data/jw/devel/fastthread/ext/fastthread/fastthread.so: undefined symbol: rb_thread_alive_p
Command failed with status (127): [/home/jw/.multiruby/install/v1_8_5/bin/rub...]

AFTER:

~/devel/fastthread [git:master@c2f3537]> ~/.multiruby/install/v1_8_5/bin/ruby -v -S rake test
ruby 1.8.5 (2006-08-25) [x86_64-linux]
gcc -I. -I/home/jw/.multiruby/install/v1_8_5/lib/ruby/1.8/x86_64-linux -I/home/jw/.multiruby/install/v1_8_5/lib/ruby/1.8/x86_64-linux -I.  -fPIC -g -O2  -c fastthread.c
gcc -shared  -L'/home/jw/.multiruby/install/v1_8_5/lib' -Wl,-R'/home/jw/.multiruby/install/v1_8_5/lib' -o fastthread.so fastthread.o  -ldl -lcrypt -lm-lc
/home/jw/.multiruby/install/v1_8_5/bin/ruby -I"/local/data/jw/devel/fastthread/lib" -I"/local/data/jw/devel/fastthread/ext" -I"/local/data/jw/devel/fastthread/bin" -I"/local/data/jw/devel/fastthread/test" "/home/jw/.multiruby/install/v1_8_5/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/test_all.rb"
Loaded suite /home/jw/.multiruby/install/v1_8_5/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader
Started
............
Finished in 0.009504 seconds.

12 tests, 54 assertions, 0 failures, 0 errors
  • Loading branch information...
commit 75995d6a097e5b55dc53c39858aea051ce74556e 1 parent c2f3537
@blackwinter blackwinter authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 ext/fastthread/fastthread.c
View
4 ext/fastthread/fastthread.c
@@ -299,7 +299,11 @@ typedef struct _Mutex {
List waiting;
} Mutex;
+#if RUBY_VERSION_MAJOR >= 1 && RUBY_VERSION_MINOR >= 9
#define MUTEX_LOCKED_P(mutex) (RTEST((mutex)->owner) && rb_thread_alive_p((mutex)->owner))
+#else
+#define MUTEX_LOCKED_P(mutex) (RTEST((mutex)->owner))
+#endif
static void
mark_mutex(Mutex *mutex)

0 comments on commit 75995d6

Please sign in to comment.
Something went wrong with that request. Please try again.