From a5e32e632f5b9cd44114bdaa311dfa7d2f4d0309 Mon Sep 17 00:00:00 2001
From: Hongli Lai (Phusion) <hongli@phusion.nl>
Date: Mon, 2 Feb 2009 13:54:21 +0100
Subject: [PATCH] Make fastthread a no-op on Ruby 1.9.

---
 ext/fastthread/fastthread.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/ext/fastthread/fastthread.c b/ext/fastthread/fastthread.c
index 355ed00..de68e89 100644
--- a/ext/fastthread/fastthread.c
+++ b/ext/fastthread/fastthread.c
@@ -10,6 +10,8 @@
  */
 
 #include <ruby.h>
+#ifndef RUBY_VM
+
 #include <intern.h>
 #include <rubysig.h>
 
@@ -1169,9 +1171,12 @@ setup_classes(VALUE unused)
     return Qnil;
 }
 
+#endif /* RUBY_VM */
+
 void
 Init_fastthread()
 {
+    #ifndef RUBY_VM
     int saved_critical;
 
     rb_require("thread");
@@ -1182,5 +1187,6 @@ Init_fastthread()
     saved_critical = rb_thread_critical;
     rb_thread_critical = 1;
     rb_ensure(setup_classes, Qnil, set_critical, (VALUE)saved_critical);
+    #endif /* RUBY_VM */
 }
 
-- 
1.5.4.3


