Only use Mutexes if Ruby knows about them (Ruby 1.8.6 issue)

This commit is contained in:
Moritz Bunkus 2010-08-01 22:06:53 +02:00
parent 2d16b68113
commit 607cc79465

View File

@ -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)