From 607cc79465c7257c84b960b7f65f01198aba53b5 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 1 Aug 2010 22:06:53 +0200 Subject: [PATCH] Only use Mutexes if Ruby knows about them (Ruby 1.8.6 issue) --- rake.d/helpers.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rake.d/helpers.rb b/rake.d/helpers.rb index 05b6282e7..7609f7559 100644 --- a/rake.d/helpers.rb +++ b/rake.d/helpers.rb @@ -1,9 +1,11 @@ -$message_mutex = Mutex.new -def puts(message) - $message_mutex.lock - $stdout.puts message - $stdout.flush - $message_mutex.unlock +if defined? Mutex + $message_mutex = Mutex.new + def puts(message) + $message_mutex.lock + $stdout.puts message + $stdout.flush + $message_mutex.unlock + end end def error(message)