end\r
\r
def dup\r
- self.class.new(@url,\r
- @handle,\r
- @type ? @type.dup : nil,\r
- @watchers.dup,\r
- @xml ? @xml.dup : nil)\r
+ @mutex.synchronize do\r
+ self.class.new(@url,\r
+ @handle,\r
+ @type ? @type.dup : nil,\r
+ @watchers.dup,\r
+ @xml ? @xml.dup : nil)\r
+ end\r
end\r
\r
# Downcase all watchers, possibly turning them into Strings if they weren't\r
if watched_by?(who)\r
return nil\r
end\r
- @watchers << who.downcase\r
+ @mutex.synchronize do\r
+ @watchers << who.downcase\r
+ end\r
return who\r
end\r
\r
def rm_watch(who)\r
- @watchers.delete(who.downcase)\r
+ @mutex.synchronize do\r
+ @watchers.delete(who.downcase)\r
+ end\r
end\r
\r
def to_a\r
def save\r
unparsed = Hash.new()\r
@feeds.each { |k, f|\r
- f.mutex.synchronize do\r
- unparsed[k] = f.dup\r
- end\r
+ unparsed[k] = f.dup\r
}\r
@registry[:feeds] = unparsed\r
end\r