Skip to content

Instantly share code, notes, and snippets.

@kronos
Created March 18, 2010 21:51
Show Gist options
  • Save kronos/336940 to your computer and use it in GitHub Desktop.
Save kronos/336940 to your computer and use it in GitHub Desktop.
From aae49a96ebadc965c06b1de877c29548c7c67168 Mon Sep 17 00:00:00 2001
From: Ivan Samsonov <[email protected]>
Date: Fri, 19 Mar 2010 00:46:47 +0300
Subject: [PATCH] Since rubinius use native threads we should require 'timeout' instead of using systimer
---
lib/memcache.rb | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/memcache.rb b/lib/memcache.rb
index 4558b00..9af48c5 100644
--- a/lib/memcache.rb
+++ b/lib/memcache.rb
@@ -12,9 +12,9 @@ begin
# Try to use the SystemTimer gem instead of Ruby's timeout library
# when running on something that looks like Ruby 1.8.x. See:
# http://ph7spot.com/articles/system_timer
- # We don't want to bother trying to load SystemTimer on jruby and
- # ruby 1.9+
- if defined?(JRUBY_VERSION) || (RUBY_VERSION >= '1.9')
+ # We don't want to bother trying to load SystemTimer on jruby,
+ # rubinius and ruby 1.9+
+ if defined?(JRUBY_VERSION) || (RUBY_ENGINE == 'rbx') ||(RUBY_VERSION >= '1.9')
require 'timeout'
MemCacheTimer = Timeout
else
--
1.6.6.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment