summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon')
-rwxr-xr-xindra/llcommon/lleventcoro.cpp9
-rwxr-xr-xindra/llcommon/lleventcoro.h2
-rwxr-xr-xindra/llcommon/lleventfilter.cpp4
-rwxr-xr-xindra/llcommon/lleventfilter.h5
4 files changed, 17 insertions, 3 deletions
diff --git a/indra/llcommon/lleventcoro.cpp b/indra/llcommon/lleventcoro.cpp
index 578a2b62c8..44291eb711 100755
--- a/indra/llcommon/lleventcoro.cpp
+++ b/indra/llcommon/lleventcoro.cpp
@@ -229,6 +229,15 @@ LLSD llcoro::postAndSuspend(const LLSD& event, const LLEventPumpOrPumpName& requ
return value;
}
+LLSD llcoro::suspendUntilEventOnWithTimeout(const LLEventPumpOrPumpName& pump, F32 timeoutin, const LLSD &timeoutResult)
+{
+ LLEventTimeout timeoutPump(pump);
+
+ timeoutPump.eventAfter(timeoutin, timeoutResult);
+ return llcoro::suspendUntilEventOn(timeoutPump);
+
+}
+
namespace
{
diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h
index 2105faf861..19c68e1f35 100755
--- a/indra/llcommon/lleventcoro.h
+++ b/indra/llcommon/lleventcoro.h
@@ -147,6 +147,8 @@ LLSD suspendUntilEventOn(const LLEventPumpOrPumpName& pump)
return postAndSuspend(LLSD(), LLEventPumpOrPumpName(), pump);
}
+LLSD suspendUntilEventOnWithTimeout(const LLEventPumpOrPumpName& pump, F32 timeoutin, const LLSD &timeoutResult);
+
} // namespace llcoro
/// return type for two-pump variant of suspendUntilEventOn()
diff --git a/indra/llcommon/lleventfilter.cpp b/indra/llcommon/lleventfilter.cpp
index d36a107254..64ab58adcd 100755
--- a/indra/llcommon/lleventfilter.cpp
+++ b/indra/llcommon/lleventfilter.cpp
@@ -39,9 +39,9 @@
#include "llsdutil.h" // llsd_matches()
LLEventFilter::LLEventFilter(LLEventPump& source, const std::string& name, bool tweak):
- LLEventStream(name, tweak)
+ LLEventStream(name, tweak),
+ mSource(source.listen(getName(), boost::bind(&LLEventFilter::post, this, _1)))
{
- source.listen(getName(), boost::bind(&LLEventFilter::post, this, _1));
}
LLEventMatching::LLEventMatching(const LLSD& pattern):
diff --git a/indra/llcommon/lleventfilter.h b/indra/llcommon/lleventfilter.h
index e822a664f5..15bac5fd73 100755
--- a/indra/llcommon/lleventfilter.h
+++ b/indra/llcommon/lleventfilter.h
@@ -49,6 +49,9 @@ public:
/// Post an event to all listeners
virtual bool post(const LLSD& event) = 0;
+
+private:
+ LLTempBoundListener mSource;
};
/**
@@ -181,7 +184,7 @@ protected:
private:
bool tick(const LLSD&);
- LLBoundListener mMainloop;
+ LLTempBoundListener mMainloop;
Action mAction;
};