Simplified mutex creation

This commit is contained in:
Kyle Banker 2009-10-19 11:46:59 -04:00
parent 2a0552d6dc
commit f642b0b3bd

View File

@ -16,7 +16,7 @@
require 'socket' require 'socket'
require 'digest/md5' require 'digest/md5'
require 'mutex_m' require 'thread'
require 'mongo/collection' require 'mongo/collection'
require 'mongo/message' require 'mongo/message'
require 'mongo/query' require 'mongo/query'
@ -137,8 +137,7 @@ module Mongo
@pk_factory = options[:pk] @pk_factory = options[:pk]
@slave_ok = options[:slave_ok] && @nodes.length == 1 # only OK if one node @slave_ok = options[:slave_ok] && @nodes.length == 1 # only OK if one node
@auto_reconnect = options[:auto_reconnect] @auto_reconnect = options[:auto_reconnect]
@semaphore = Object.new @semaphore = Mutex.new
@semaphore.extend Mutex_m
@socket = nil @socket = nil
@logger = options[:logger] @logger = options[:logger]
connect_to_master connect_to_master