summaryrefslogtreecommitdiff
path: root/lib/rbot/ircbot.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-08-05 12:20:46 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-08-05 12:20:46 +0000
commit27a1965cc7b57e9de6d69504faaa3915a7cc959e (patch)
tree58f487333d5458224859d6370b5f2a3a2756b51f /lib/rbot/ircbot.rb
parent3b99e8a0cbe61aa6ad025eb47f8487d947047b3f (diff)
Fix some save/quit/rescan races
Diffstat (limited to 'lib/rbot/ircbot.rb')
-rw-r--r--lib/rbot/ircbot.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index d83a5fe4..f5250b9b 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -809,7 +809,9 @@ class IrcBot
debug "Saving"
save
debug "Cleaning up"
- @plugins.cleanup
+ @save_mutex.synchronize do
+ @plugins.cleanup
+ end
# debug "Closing registries"
# @registry.close
debug "Cleaning up the db environment"
@@ -848,8 +850,10 @@ class IrcBot
# call the rescan method for all of the botmodules
def rescan
- @lang.rescan
- @plugins.rescan
+ @save_mutex.synchronize do
+ @lang.rescan
+ @plugins.rescan
+ end
end
# channel:: channel to join