From 2763bbd97519d35a43aedf279751e7b1045581dc Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 4 Dec 2015 14:27:22 -0800 Subject: Initial changes for Vivox/Azumarill merge. Lots of temporary code and conditional compile switches. Begin switch from statemachine to coroutine. --- indra/llcommon/llevents.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/llcommon/llevents.cpp') diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 1c928b3db8..bb3a137815 100755 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -132,6 +132,17 @@ LLEventPump& LLEventPumps::obtain(const std::string& name) return *newInstance; } +bool LLEventPumps::post(const std::string&name, const LLSD&message) +{ + PumpMap::iterator found = mPumpMap.find(name); + + if (found == mPumpMap.end()) + return false; + + return (*found).second->post(message); +} + + void LLEventPumps::flush() { // Flush every known LLEventPump instance. Leave it up to each instance to -- cgit v1.2.3 From 83c9c6df07ab602bdbd2487e587956d0e67993e2 Mon Sep 17 00:00:00 2001 From: rider Date: Thu, 17 Dec 2015 09:06:19 -0800 Subject: MAINT-5976: Adding MailDrop type event Queue --- indra/llcommon/llevents.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'indra/llcommon/llevents.cpp') diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index bb3a137815..080830a134 100755 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -507,6 +507,37 @@ bool LLEventStream::post(const LLSD& event) return (*signal)(event); } +/***************************************************************************** + * LLEventMailDrop + *****************************************************************************/ +bool LLEventMailDrop::post(const LLSD& event) +{ + bool posted = LLEventPump::post(event); + + if (!posted) + { + mEventHistory.push_back(event); + } + + return posted; +} + +LLBoundListener LLEventMailDrop::listen_impl(const std::string& name, + const LLEventListener& listener, + const NameList& after, + const NameList& before) +{ + LLBoundListener bndlistener = LLEventPump::listen_impl(name, listener, after, before); + + return bndlistener; +} + +// typedef std::list EventList; +// EventList mEventHistory; + + + + /***************************************************************************** * LLEventQueue *****************************************************************************/ -- cgit v1.2.3 From 2c9097aa28d65eeddcfb60b9ac93495723ed6419 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 17 Dec 2015 14:09:51 -0800 Subject: MAINT-5977: Finish implementation of MailBox event pump type for guaranteed delivery --- indra/llcommon/llevents.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'indra/llcommon/llevents.cpp') diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 080830a134..fc2d8d5e23 100755 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -512,10 +512,11 @@ bool LLEventStream::post(const LLSD& event) *****************************************************************************/ bool LLEventMailDrop::post(const LLSD& event) { - bool posted = LLEventPump::post(event); + bool posted = LLEventStream::post(event); if (!posted) - { + { // if the event was not handled we will save it for later so that it can + // be posted to any future listeners when they attach. mEventHistory.push_back(event); } @@ -527,15 +528,17 @@ LLBoundListener LLEventMailDrop::listen_impl(const std::string& name, const NameList& after, const NameList& before) { - LLBoundListener bndlistener = LLEventPump::listen_impl(name, listener, after, before); - - return bndlistener; -} - -// typedef std::list EventList; -// EventList mEventHistory; + if (!mEventHistory.empty()) + { + if (listener(mEventHistory.front())) + { + mEventHistory.pop_front(); + } + } + return LLEventStream::listen_impl(name, listener, after, before); +} /***************************************************************************** -- cgit v1.2.3 From 6851dd30cae7c748f4fc953de268f7989787501c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 17 Dec 2015 14:53:21 -0800 Subject: MAINT-5977: Check get_consuming() as well as listener return when draining queue. --- indra/llcommon/llevents.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llevents.cpp') diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index fc2d8d5e23..0c5e55dc76 100755 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -57,6 +57,7 @@ #include "stringize.h" #include "llerror.h" #include "llsdutil.h" +#include "llcoros.h" #if LL_MSVC #pragma warning (disable : 4702) #endif @@ -512,7 +513,10 @@ bool LLEventStream::post(const LLSD& event) *****************************************************************************/ bool LLEventMailDrop::post(const LLSD& event) { - bool posted = LLEventStream::post(event); + bool posted = false; + + if (!mSignal->empty()) + posted = LLEventStream::post(event); if (!posted) { // if the event was not handled we will save it for later so that it can @@ -530,7 +534,7 @@ LLBoundListener LLEventMailDrop::listen_impl(const std::string& name, { if (!mEventHistory.empty()) { - if (listener(mEventHistory.front())) + if (listener(mEventHistory.front()) || LLCoros::get_consuming()) { mEventHistory.pop_front(); } -- cgit v1.2.3 From ae1c75c1c80ce4ad658dac960ca68e308eec5322 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 22 Dec 2015 10:17:44 -0800 Subject: MAINT-5976: Removed temp code to simulate Nat's fix. Now redundant. --- indra/llcommon/llevents.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llcommon/llevents.cpp') diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 0c5e55dc76..645c29d770 100755 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -57,7 +57,6 @@ #include "stringize.h" #include "llerror.h" #include "llsdutil.h" -#include "llcoros.h" #if LL_MSVC #pragma warning (disable : 4702) #endif @@ -534,7 +533,7 @@ LLBoundListener LLEventMailDrop::listen_impl(const std::string& name, { if (!mEventHistory.empty()) { - if (listener(mEventHistory.front()) || LLCoros::get_consuming()) + if (listener(mEventHistory.front())) { mEventHistory.pop_front(); } -- cgit v1.2.3