Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Jens Wille authored March 24, 2009

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  ext/fastthread/fastthread.c
4  ext/fastthread/fastthread.c
@@ -299,7 +299,11 @@ typedef struct _Mutex {
299 299
     List waiting;
300 300
 } Mutex;
301 301
 
  302
+#if RUBY_VERSION_MAJOR >= 1 && RUBY_VERSION_MINOR >= 9
302 303
 #define MUTEX_LOCKED_P(mutex) (RTEST((mutex)->owner) && rb_thread_alive_p((mutex)->owner))
  304
+#else
  305
+#define MUTEX_LOCKED_P(mutex) (RTEST((mutex)->owner))
  306
+#endif
303 307
 
304 308
 static void
305 309
 mark_mutex(Mutex *mutex)

0 notes on commit 75995d6

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