commit ae5b2852b65c8317626386dc2e21943e81cb1bbf
parent ceab77670a773accc77f497891bdc768058f7dec
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date: Mon, 20 Aug 2007 01:14:42 +0000
disallow concurrent polls
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@531 5c8cc53c-5e98-4d25-b20a-d8db53a31250
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
@@ -27,6 +27,7 @@ EOS
@mutex = Mutex.new
@thread = nil
@last_poll = nil
+ @polling = false
self.class.i_am_the_instance self
end
@@ -36,6 +37,8 @@ EOS
end
def poll
+ return if @polling
+ @polling = true
HookManager.run "before-poll"
BufferManager.flash "Polling for new messages..."
@@ -48,6 +51,7 @@ EOS
HookManager.run "after-poll", :num => num, :num_inbox => numi, :from_and_subj => from_and_subj, :from_and_subj_inbox => from_and_subj_inbox
+ @polling = false
[num, numi]
end