Permalink
Browse files

Method to determine whether threading (well, Celluloid) is safe on th…

…is platform.
  • Loading branch information...
1 parent 35ce1b1 commit 10d87c9ed42421a3a175e7c5c5574fb9f4d8c744 @mboeh committed Mar 26, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/woodhouse.rb
View
@@ -47,6 +47,11 @@ def layout
yield Woodhouse::LayoutBuilder.new(Woodhouse.global_configuration, @global_layout)
end
+ # Returns +true+ on JRuby, Rubinius, or MRI 1.9. +false+ otherwise.
+ def threading_safe?
+ RUBY_VERSION.to_f >= 1.9 or %w[jruby rbx].include?(RUBY_ENGINE)
+ end
+
def dispatch(*a)
global_configuration.dispatcher.dispatch(*a)
end

0 comments on commit 10d87c9

Please sign in to comment.