From 1b189336a61beeb8c24f34bed8b3c2f8e9a717f7 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Tue, 29 Dec 2009 12:22:01 -0500 Subject: [PATCH] minor: test tweaks for windows --- lib/mongo/connection.rb | 10 +++++----- test/test_threading.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/mongo/connection.rb b/lib/mongo/connection.rb index 3d32184..0f4190d 100644 --- a/lib/mongo/connection.rb +++ b/lib/mongo/connection.rb @@ -297,15 +297,15 @@ module Mongo def checkin(socket) @connection_mutex.synchronize do @checked_out.delete(socket) + @queue.signal end - @queue.signal true end # Adds a new socket to the pool and checks it out. # - # This method is called exclusively from #obtain_socket; - # therefore, it runs within a mutex, as it must. + # This method is called exclusively from #checkout; + # therefore, it runs within a mutex. def checkout_new_socket begin socket = TCPSocket.new(@host, @port) @@ -320,8 +320,8 @@ module Mongo # Checks out the first available socket from the pool. # - # This method is called exclusively from #obtain_socket; - # therefore, it runs within a mutex, as it must. + # This method is called exclusively from #checkout; + # therefore, it runs within a mutex. def checkout_existing_socket socket = (@sockets - @checked_out).first @checked_out << socket diff --git a/test/test_threading.rb b/test/test_threading.rb index 0e9dfd2..9cccb9f 100644 --- a/test/test_threading.rb +++ b/test/test_threading.rb @@ -4,7 +4,7 @@ class TestThreading < Test::Unit::TestCase include Mongo - @@db = Connection.new('localhost', 27017, :pool_size => 1, :timeout => 5).db('ruby-mongo-test') + @@db = Connection.new('localhost', 27017, :pool_size => 1, :timeout => 30).db('ruby-mongo-test') @@coll = @@db.collection('thread-test-collection') def set_up_safe_data