MAINT-5232: Make gMessageSystem an LLPounceable<LLMessageSystem*>.
This will permit other subsystems to use gMessageSystem.callWhenReady() to (e.g.) register callbacks as soon as gMessageSystem is fully initialized.master
parent
df3da84624
commit
4302637464
|
|
@ -77,6 +77,7 @@
|
|||
#include "v3math.h"
|
||||
#include "v4math.h"
|
||||
#include "lltransfertargetvfile.h"
|
||||
#include "llpounceable.h"
|
||||
|
||||
// Constants
|
||||
//const char* MESSAGE_LOG_FILENAME = "message.log";
|
||||
|
|
@ -1776,7 +1777,9 @@ std::ostream& operator<<(std::ostream& s, LLMessageSystem &msg)
|
|||
return s;
|
||||
}
|
||||
|
||||
LLMessageSystem *gMessageSystem = NULL;
|
||||
// LLPounceable supports callWhenReady(), to permit clients to queue up (e.g.)
|
||||
// callback registrations for when gMessageSystem is first assigned
|
||||
LLPounceable<LLMessageSystem*, LLPounceableStatic> gMessageSystem;
|
||||
|
||||
// update appropriate ping info
|
||||
void process_complete_ping_check(LLMessageSystem *msgsystem, void** /*user_data*/)
|
||||
|
|
@ -2693,7 +2696,7 @@ void end_messaging_system(bool print_summary)
|
|||
LL_INFOS("Messaging") << str.str().c_str() << LL_ENDL;
|
||||
}
|
||||
|
||||
delete gMessageSystem;
|
||||
delete static_cast<LLMessageSystem*>(gMessageSystem);
|
||||
gMessageSystem = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
#include "llmessagesenderinterface.h"
|
||||
|
||||
#include "llstoredmessage.h"
|
||||
#include "llpounceable.h"
|
||||
|
||||
const U32 MESSAGE_MAX_STRINGS_LENGTH = 64;
|
||||
const U32 MESSAGE_NUMBER_OF_HASH_BUCKETS = 8192;
|
||||
|
|
@ -830,7 +831,7 @@ private:
|
|||
|
||||
|
||||
// external hook into messaging system
|
||||
extern LLMessageSystem *gMessageSystem;
|
||||
extern LLPounceable<LLMessageSystem*, LLPounceableStatic> gMessageSystem;
|
||||
|
||||
// Must specific overall system version, which is used to determine
|
||||
// if a patch is available in the message template checksum verification.
|
||||
|
|
|
|||
|
|
@ -31,11 +31,12 @@
|
|||
#include "llhost.h"
|
||||
#include "message.h"
|
||||
#include "llsd.h"
|
||||
#include "llpounceable.h"
|
||||
|
||||
#include "llhost.cpp" // Needed for copy operator
|
||||
#include "net.cpp" // Needed by LLHost.
|
||||
|
||||
LLMessageSystem * gMessageSystem = NULL;
|
||||
LLPounceable<LLMessageSystem*, LLPounceableStatic> gMessageSystem;
|
||||
|
||||
// sensor test doubles
|
||||
bool gClearRecvWasCalled = false;
|
||||
|
|
|
|||
|
|
@ -33,8 +33,9 @@
|
|||
#include "message.h"
|
||||
#include "llmessageconfig.h"
|
||||
#include "llhttpnode_stub.cpp"
|
||||
#include "llpounceable.h"
|
||||
|
||||
LLMessageSystem* gMessageSystem = NULL;
|
||||
LLPounceable<LLMessageSystem*, LLPounceableStatic> gMessageSystem;
|
||||
|
||||
LLMessageConfig::SenderTrust
|
||||
LLMessageConfig::getSenderTrustedness(const std::string& msg_name)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "llcachename.h"
|
||||
#include "lluuid.h"
|
||||
#include "message.h"
|
||||
#include "llpounceable.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
|
@ -167,7 +168,7 @@ char const* const _PREHASH_AgentID = (char *)"AgentID";
|
|||
|
||||
LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS);
|
||||
|
||||
LLMessageSystem* gMessageSystem = NULL;
|
||||
LLPounceable<LLMessageSystem*, LLPounceableStatic> gMessageSystem;
|
||||
|
||||
//
|
||||
// Stub implementation for LLMessageSystem
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "../llagent.h"
|
||||
#include "message.h"
|
||||
#include "llurlentry.h"
|
||||
#include "llpounceable.h"
|
||||
|
||||
namespace {
|
||||
const LLUUID TEST_PARCEL_ID("11111111-1111-1111-1111-111111111111");
|
||||
|
|
@ -61,7 +62,7 @@ void LLMessageSystem::addUUID(char const *,LLUUID const &) { }
|
|||
void LLMessageSystem::addUUIDFast(char const *,LLUUID const &) { }
|
||||
void LLMessageSystem::nextBlockFast(char const *) { }
|
||||
void LLMessageSystem::newMessage(char const *) { }
|
||||
LLMessageSystem * gMessageSystem;
|
||||
LLPounceable<LLMessageSystem*, LLPounceableStatic> gMessageSystem;
|
||||
char const* const _PREHASH_AgentID = 0; // never dereferenced during this test
|
||||
char const* const _PREHASH_AgentData = 0; // never dereferenced during this test
|
||||
LLAgent gAgent;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace tut
|
|||
~LLMessageSystemTestData()
|
||||
{
|
||||
// not end_messaging_system()
|
||||
delete gMessageSystem;
|
||||
delete static_cast<LLMessageSystem*>(gMessageSystem);
|
||||
gMessageSystem = NULL;
|
||||
|
||||
// rm contents of temp dir
|
||||
|
|
|
|||
Loading…
Reference in New Issue