From ae5b2852b65c8317626386dc2e21943e81cb1bbf Mon Sep 17 00:00:00 2001 From: wmorgan Date: Mon, 20 Aug 2007 01:14:42 +0000 Subject: [PATCH] disallow concurrent polls git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@531 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- lib/sup/poll.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb index 45e6210..f8c6845 100644 --- 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 -- 2.45.2