As AIStateMachine moved outside newview, there is no longer any need to pass AIStateMachine::flush to initCurl()

This commit is contained in:
Aleric Inglewood
2012-11-07 02:05:30 +01:00
parent e88c39b090
commit 1a43bc8abf
3 changed files with 5 additions and 10 deletions

View File

@@ -90,7 +90,6 @@ enum gSSLlib_type {
// No locking needed: initialized before threads are created, and subsequently only read. // No locking needed: initialized before threads are created, and subsequently only read.
gSSLlib_type gSSLlib; gSSLlib_type gSSLlib;
bool gSetoptParamsNeedDup; bool gSetoptParamsNeedDup;
void (*statemachines_flush_hook)(void);
} // namespace } // namespace
@@ -291,9 +290,9 @@ static unsigned int encoded_version(int major, int minor, int patch)
namespace AICurlInterface { namespace AICurlInterface {
// MAIN-THREAD // MAIN-THREAD
void initCurl(void (*flush_hook)()) void initCurl(void)
{ {
DoutEntering(dc::curl, "AICurlInterface::initCurl(" << (void*)flush_hook << ")"); DoutEntering(dc::curl, "AICurlInterface::initCurl()");
llassert(LLThread::getRunning() == 0); // We must not call curl_global_init unless we are the only thread. llassert(LLThread::getRunning() == 0); // We must not call curl_global_init unless we are the only thread.
CURLcode res = curl_global_init(CURL_GLOBAL_ALL); CURLcode res = curl_global_init(CURL_GLOBAL_ALL);
@@ -376,9 +375,6 @@ void initCurl(void (*flush_hook)())
} }
llassert_always(!gSetoptParamsNeedDup); // Might add support later. llassert_always(!gSetoptParamsNeedDup); // Might add support later.
} }
// Called in cleanupCurl.
statemachines_flush_hook = flush_hook;
} }
// MAIN-THREAD // MAIN-THREAD
@@ -391,8 +387,7 @@ void cleanupCurl(void)
stopCurlThread(); stopCurlThread();
if (CurlMultiHandle::getTotalMultiHandles() != 0) if (CurlMultiHandle::getTotalMultiHandles() != 0)
llwarns << "Not all CurlMultiHandle objects were destroyed!" << llendl; llwarns << "Not all CurlMultiHandle objects were destroyed!" << llendl;
if (statemachines_flush_hook) AIStateMachine::flush();
(*statemachines_flush_hook)();
Stats::print(); Stats::print();
ssl_cleanup(); ssl_cleanup();

View File

@@ -136,7 +136,7 @@ bool handleNoVerifySSLCert(LLSD const& newvalue);
// Called once at start of application (from newview/llappviewer.cpp by main thread (before threads are created)), // Called once at start of application (from newview/llappviewer.cpp by main thread (before threads are created)),
// with main purpose to initialize curl. // with main purpose to initialize curl.
void initCurl(void (*)(void) = NULL); void initCurl(void);
// Called once at start of application (from LLAppViewer::initThreads), starts AICurlThread. // Called once at start of application (from LLAppViewer::initThreads), starts AICurlThread.
void startCurlThread(U32 CurlConcurrentConnections, bool NoVerifySSLCert); void startCurlThread(U32 CurlConcurrentConnections, bool NoVerifySSLCert);

View File

@@ -617,7 +617,7 @@ bool LLAppViewer::init()
// <edit> // <edit>
// Curl must be initialized before any thread is running. // Curl must be initialized before any thread is running.
AICurlInterface::initCurl(&AIStateMachine::flush); AICurlInterface::initCurl();
// Logging is initialized. Now it's safe to start the error thread. // Logging is initialized. Now it's safe to start the error thread.
startErrorThread(); startErrorThread();