summaryrefslogtreecommitdiff
path: root/indra/newview/lllogchat.h
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2014-05-20 10:03:09 -0700
committerdolphin <dolphin@lindenlab.com>2014-05-20 10:03:09 -0700
commit0481494c2df074d2b548d6b80e595a208a2848c3 (patch)
treef3554fc49b549a4ae2b9d1e9a5f157e478ee38df /indra/newview/lllogchat.h
parent4c7b0cb528f61bc20866c2f7c43049ef7bc49bf2 (diff)
parent644ca6a0f8a7759119814f88df93b8e838321a12 (diff)
Merge with 3.7.8-release
Diffstat (limited to 'indra/newview/lllogchat.h')
-rwxr-xr-xindra/newview/lllogchat.h64
1 files changed, 53 insertions, 11 deletions
diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h
index 86610f99b3..ca597599dd 100755
--- a/indra/newview/lllogchat.h
+++ b/indra/newview/lllogchat.h
@@ -29,23 +29,54 @@
#include "llthread.h"
class LLChat;
-class LLLoadHistoryThread : public LLThread
+
+class LLActionThread : public LLThread
{
+public:
+ LLActionThread(const std::string& name);
+ ~LLActionThread();
+
+ void waitFinished();
+ bool isFinished() { return mFinished; }
+protected:
+ void setFinished();
private:
- std::string mFileName;
- std::list<LLSD> mMessages;
+ bool mFinished;
+ LLMutex mMutex;
+ LLCondition mRunCondition;
+};
+
+class LLLoadHistoryThread : public LLActionThread
+{
+private:
+ const std::string& mFileName;
+ std::list<LLSD>* mMessages;
LLSD mLoadParams;
bool mNewLoad;
public:
- LLLoadHistoryThread();
-
- void setHistoryParams(const std::string& file_name, const LLSD& load_params);
- virtual void loadHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params);
+ LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params);
+ ~LLLoadHistoryThread();
+ //void setHistoryParams(const std::string& file_name, const LLSD& load_params);
+ virtual void loadHistory(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params);
virtual void run();
- typedef boost::signals2::signal<void (std::list<LLSD>& messages,const std::string& file_name)> load_end_signal_t;
- static load_end_signal_t * mLoadEndSignal;
- static boost::signals2::connection setLoadEndSignal(const load_end_signal_t::slot_type& cb);
+ typedef boost::signals2::signal<void (std::list<LLSD>* messages,const std::string& file_name)> load_end_signal_t;
+ load_end_signal_t * mLoadEndSignal;
+ boost::signals2::connection setLoadEndSignal(const load_end_signal_t::slot_type& cb);
+ void removeLoadEndSignal(const load_end_signal_t::slot_type& cb);
+};
+
+class LLDeleteHistoryThread : public LLActionThread
+{
+private:
+ std::list<LLSD>* mMessages;
+ LLLoadHistoryThread* mLoadThread;
+public:
+ LLDeleteHistoryThread(std::list<LLSD>* messages, LLLoadHistoryThread* loadThread);
+ ~LLDeleteHistoryThread();
+
+ virtual void run();
+ static void deleteHistory();
};
class LLLogChat
@@ -74,7 +105,6 @@ public:
static void getListOfTranscriptBackupFiles(std::vector<std::string>& list_of_transcriptions);
static void loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params = LLSD());
- static void startChatHistoryThread(const std::string& file_name, const LLSD& load_params);
typedef boost::signals2::signal<void ()> save_history_signal_t;
static boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb);
@@ -91,9 +121,21 @@ public:
static bool isTranscriptExist(const LLUUID& avatar_id, bool is_group=false);
static bool isNearbyTranscriptExist();
+ static bool historyThreadsFinished(LLUUID session_id);
+ static LLLoadHistoryThread* getLoadHistoryThread(LLUUID session_id);
+ static LLDeleteHistoryThread* getDeleteHistoryThread(LLUUID session_id);
+ static bool addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread);
+ static bool addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread);
+ static void cleanupHistoryThreads();
+
private:
static std::string cleanFileName(std::string filename);
static save_history_signal_t * sSaveHistorySignal;
+
+ static std::map<LLUUID,LLLoadHistoryThread *> sLoadHistoryThreads;
+ static std::map<LLUUID,LLDeleteHistoryThread *> sDeleteHistoryThreads;
+ static LLMutex* sHistoryThreadsMutex;
+ static LLMutex* historyThreadsMutex();
};
/**