diff options
| -rw-r--r-- | indra/cmake/Boost.cmake | 9 | ||||
| -rw-r--r-- | indra/llcorehttp/_httpservice.cpp | 47 | ||||
| -rw-r--r-- | indra/llcorehttp/_httpservice.h | 2 | ||||
| -rw-r--r-- | indra/llcorehttp/_mutex.h | 11 | ||||
| -rw-r--r-- | indra/llcorehttp/_refcounted.h | 8 | ||||
| -rw-r--r-- | indra/llcorehttp/_thread.h | 100 | ||||
| -rw-r--r-- | indra/llprimitive/llmodel.h | 2 | ||||
| -rw-r--r-- | indra/llrender/llrender.h | 5 | ||||
| -rw-r--r-- | indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc | 2 | ||||
| -rw-r--r-- | indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llgltfmaterialpreviewmgr.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llpathfindingnavmesh.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llversioninfo.cpp | 11 | ||||
| -rw-r--r-- | indra/newview/llversioninfo.h | 1 | ||||
| -rw-r--r-- | indra/newview/llversioninfovars.h.in | 1 |
15 files changed, 90 insertions, 118 deletions
diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 610a4f6232..5967a96f8a 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -65,14 +65,6 @@ find_library(BOOST_SYSTEM_LIBRARY boost_system-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) -find_library(BOOST_THREAD_LIBRARY - NAMES - libboost_thread-mt - libboost_thread-mt${addrsfx} - boost_thread-mt - boost_thread-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - find_library(BOOST_URL_LIBRARY NAMES libboost_url-mt @@ -88,7 +80,6 @@ target_link_libraries(ll::boost INTERFACE ${BOOST_PROGRAMOPTIONS_LIBRARY} ${BOOST_REGEX_LIBRARY} ${BOOST_SYSTEM_LIBRARY} - ${BOOST_THREAD_LIBRARY} ${BOOST_URL_LIBRARY}) if (LINUX) diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 03a2eab8e3..323a18c02a 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -71,7 +71,6 @@ volatile HttpService::EState HttpService::sState(NOT_INITIALIZED); HttpService::HttpService() : mRequestQueue(NULL), mExitRequested(0U), - mThread(NULL), mPolicy(NULL), mTransport(NULL), mLastPolicy(0) @@ -90,23 +89,30 @@ HttpService::~HttpService() { if (mRequestQueue->stopQueue()) { - // Give mRequestQueue a chance to finish - ms_sleep(10); + // Now wait a bit for the thread to exit + S32 counter = 0; + const S32 MAX_WAIT = 600; + while (counter < MAX_WAIT) + { + if (STOPPED == sState) + { + break; + } + // Sleep for a tenth of a second + ms_sleep(100); + std::this_thread::yield(); + counter++; + } } } - if (mThread) + if (mThread && RUNNING == sState) { - if (! mThread->timedJoin(250)) - { - // Failed to join, expect problems ahead so do a hard termination. - LL_WARNS(LOG_CORE) << "Destroying HttpService with running thread. Expect problems." << LL_NEWLINE - << "State: " << S32(sState) - << " Last policy: " << U32(mLastPolicy) - << LL_ENDL; + // Failed to shutdown, expect problems ahead so do a hard termination. + LL_WARNS(LOG_CORE) << "Destroying HttpService with running thread. Expect problems." << LL_NEWLINE << "State: " << S32(sState) + << " Last policy: " << U32(mLastPolicy) << LL_ENDL; - mThread->cancel(); - } + mThread->cancel(); } } @@ -122,11 +128,7 @@ HttpService::~HttpService() delete mPolicy; mPolicy = NULL; - if (mThread) - { - mThread->release(); - mThread = NULL; - } + mThread.reset(); } @@ -205,14 +207,15 @@ void HttpService::startThread() if (mThread) { - mThread->release(); + mThread.reset(); } // Push current policy definitions, enable policy & transport components mPolicy->start(); mTransport->start(mLastPolicy + 1); - mThread = new LLCoreInt::HttpThread(boost::bind(&HttpService::threadRun, this, _1)); + mThread = std::make_unique<LLCoreInt::HttpThread>(boost::bind(&HttpService::threadRun, this, _1)); + mThread->detach(); // Detach thread to let it clean its self up sState = RUNNING; } @@ -286,8 +289,6 @@ void HttpService::threadRun(LLCoreInt::HttpThread * thread) set_thread_name("HttpService"); LL_PROFILER_SET_THREAD_NAME("HttpService"); - boost::this_thread::disable_interruption di; - ELoopSpeed loop(REQUEST_SLEEP); while (! mExitRequested) { @@ -314,7 +315,7 @@ void HttpService::threadRun(LLCoreInt::HttpThread * thread) { LOG_UNHANDLED_EXCEPTION(""); } - catch (std::bad_alloc&) + catch (const std::bad_alloc&) { LLMemory::logMemoryInfo(true); diff --git a/indra/llcorehttp/_httpservice.h b/indra/llcorehttp/_httpservice.h index 13eb034f0e..bdf03f5227 100644 --- a/indra/llcorehttp/_httpservice.h +++ b/indra/llcorehttp/_httpservice.h @@ -218,7 +218,7 @@ protected: static volatile EState sState; HttpRequestQueue * mRequestQueue; // Refcounted LLAtomicU32 mExitRequested; - LLCoreInt::HttpThread * mThread; + std::unique_ptr<LLCoreInt::HttpThread> mThread; // === working-thread-only data === HttpPolicy * mPolicy; // Simple pointer, has ownership diff --git a/indra/llcorehttp/_mutex.h b/indra/llcorehttp/_mutex.h index 5e0164eb51..43782d3a37 100644 --- a/indra/llcorehttp/_mutex.h +++ b/indra/llcorehttp/_mutex.h @@ -27,9 +27,8 @@ #ifndef LLCOREINT_MUTEX_H_ #define LLCOREINT_MUTEX_H_ - -#include <boost/thread.hpp> - +#include <condition_variable> +#include <mutex> namespace LLCoreInt { @@ -37,17 +36,17 @@ namespace LLCoreInt // MUTEX TYPES // unique mutex type -typedef boost::mutex HttpMutex; +typedef std::mutex HttpMutex; // CONDITION VARIABLES // standard condition variable -typedef boost::condition_variable HttpConditionVariable; +typedef std::condition_variable HttpConditionVariable; // LOCKS AND FENCES // scoped unique lock -typedef boost::unique_lock<HttpMutex> HttpScopedLock; +typedef std::unique_lock<HttpMutex> HttpScopedLock; } diff --git a/indra/llcorehttp/_refcounted.h b/indra/llcorehttp/_refcounted.h index 7470965a7f..45fe3cb090 100644 --- a/indra/llcorehttp/_refcounted.h +++ b/indra/llcorehttp/_refcounted.h @@ -43,11 +43,11 @@ namespace LLCoreInt class RefCounted { -private: - RefCounted(); // Not defined - may not be default constructed - void operator=(const RefCounted &); // Not defined - public: + RefCounted() = delete; // Not defined - may not be default constructed + RefCounted(const RefCounted&) = delete; // Not defined - may not be copy constructed + void operator=(const RefCounted&) = delete; // Not defined + explicit RefCounted(bool const implicit) : mRefCount(implicit) {} diff --git a/indra/llcorehttp/_thread.h b/indra/llcorehttp/_thread.h index 6c0e39cf92..956a220524 100644 --- a/indra/llcorehttp/_thread.h +++ b/indra/llcorehttp/_thread.h @@ -29,92 +29,74 @@ #include "linden_common.h" -#include <boost/thread.hpp> -#include <boost/function.hpp> -#include <boost/date_time/posix_time/posix_time_types.hpp> +#include <functional> +#include <thread> -#include "apr.h" // thread-related functions #include "_refcounted.h" namespace LLCoreInt { -class HttpThread : public RefCounted +class HttpThread { -private: - HttpThread(); // Not defined - void operator=(const HttpThread &); // Not defined - - void at_exit() - { - // the thread function has exited so we need to release our reference - // to ourself so that we will be automagically cleaned up. - release(); - } +public: + HttpThread() = delete; // Not defined + void operator=(const HttpThread &) = delete; // Not defined +private: void run() - { // THREAD CONTEXT - - // Take out additional reference for the at_exit handler - addRef(); - boost::this_thread::at_thread_exit(boost::bind(&HttpThread::at_exit, this)); - - // run the thread function - mThreadFunc(this); - - } // THREAD CONTEXT - -protected: - virtual ~HttpThread() - { - delete mThread; - } + { // THREAD CONTEXT + // run the thread function + mThreadFunc(this); + } // THREAD CONTEXT public: /// Constructs a thread object for concurrent execution but does /// not start running. Caller receives on refcount on the thread /// instance. If the thread is started, another will be taken /// out for the exit handler. - explicit HttpThread(boost::function<void (HttpThread *)> threadFunc) - : RefCounted(true), // implicit reference - mThreadFunc(threadFunc) - { - // this creates a boost thread that will call HttpThread::run on this instance - // and pass it the threadfunc callable... - boost::function<void()> f = boost::bind(&HttpThread::run, this); + explicit HttpThread(std::function<void (HttpThread *)> threadFunc) + : mThreadFunc(threadFunc) + { + // this creates a std thread that will call HttpThread::run on this instance + // and pass it the threadfunc callable... + std::function<void()> f = std::bind(&HttpThread::run, this); - mThread = new boost::thread(f); - } + mThread = std::make_unique<std::thread>(f); + mNativeHandle = mThread->native_handle(); + } - inline void join() - { - mThread->join(); - } + ~HttpThread() = default; - inline bool timedJoin(S32 millis) - { - return mThread->timed_join(boost::posix_time::milliseconds(millis)); - } + inline void join() + { + mThread->join(); + } inline bool joinable() const - { - return mThread->joinable(); - } + { + return mThread->joinable(); + } + + inline void detach() + { + mThread->detach(); + } // A very hostile method to force a thread to quit inline void cancel() - { - boost::thread::native_handle_type thread(mThread->native_handle()); -#if LL_WINDOWS - TerminateThread(thread, 0); + { +#if LL_WINDOWS + TerminateThread(mNativeHandle, 0); #else - pthread_cancel(thread); + pthread_cancel(mNativeHandle); #endif - } + } private: - boost::function<void(HttpThread *)> mThreadFunc; - boost::thread * mThread; + std::function<void(HttpThread *)> mThreadFunc; + std::unique_ptr<std::thread> mThread; + std::thread::native_handle_type mNativeHandle; }; // end class HttpThread } // end namespace LLCoreInt diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 26448069c6..d624b6dc7a 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -33,8 +33,6 @@ #include "m4math.h" #include <queue> -#include <boost/align/aligned_allocator.hpp> - class daeElement; class domMesh; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 4bfc5723ee..9c17cf3470 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -43,7 +43,6 @@ #include "llglheaders.h" #include "llmatrix4a.h" #include "glm/mat4x4.hpp" -#include <boost/align/aligned_allocator.hpp> #include <array> #include <chrono> @@ -531,8 +530,8 @@ private: eBlendFactor mCurrBlendAlphaSFactor; eBlendFactor mCurrBlendAlphaDFactor; - std::vector<LLVector4a, boost::alignment::aligned_allocator<LLVector4a, 16> > mUIOffset; - std::vector<LLVector4a, boost::alignment::aligned_allocator<LLVector4a, 16> > mUIScale; + std::vector<LLVector4a> mUIOffset; + std::vector<LLVector4a> mUIScale; struct LLVBCache { diff --git a/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc b/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc index 6f5bb04bdf..e3b959f2b6 100644 --- a/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc +++ b/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc @@ -32,7 +32,7 @@ LL_GRAB_SYM(G, false, gst_registry_fork_set_enabled, void, gboolean enabled) LL_GRAB_SYM(G, false, gst_segtrap_set_enabled, void, gboolean enabled) LL_GRAB_SYM(G, false, gst_message_parse_buffering, void, GstMessage *message, gint *percent) LL_GRAB_SYM(G, false, gst_message_parse_info, void, GstMessage *message, GError **gerror, gchar **debug) -LL_GRAB_SYM(G, false, gst_element_query_position, gboolean, GstElement *element, GstFormat *format, gint64 *cur) +LL_GRAB_SYM(G, false, gst_element_query_position, gboolean, GstElement *element, GstFormat format, gint64 *cur) LL_GRAB_SYM(G, false, gst_version, void, guint *major, guint *minor, guint *micro, guint *nano) LL_GRAB_SYM(G, true, gst_message_parse_tag, void, GstMessage *, GstTagList **) diff --git a/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp b/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp index 0f45c151a2..5fdea56920 100644 --- a/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp +++ b/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp @@ -506,7 +506,7 @@ bool MediaPluginGStreamer10::getTimePos(double &sec_out) got_position = llgst_element_query_position && llgst_element_query_position(mPlaybin, - &timefmt, + timefmt, &pos); got_position = got_position && (timefmt == GST_FORMAT_TIME); diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index e7b988aef5..446742f316 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -520,21 +520,17 @@ bool LLGLTFPreviewTexture::render() // *HACK: Hide mExposureMap from generateExposure gPipeline.mExposureMap.swapFBORefs(gPipeline.mLastExposure); - gPipeline.copyScreenSpaceReflections(&screen, &gPipeline.mSceneMap); gPipeline.generateLuminance(&screen, &gPipeline.mLuminanceMap); gPipeline.generateExposure(&gPipeline.mLuminanceMap, &gPipeline.mExposureMap, /*use_history = */ false); gPipeline.gammaCorrect(&screen, &gPipeline.mPostPingMap); LLVertexBuffer::unbind(); gPipeline.generateGlow(&gPipeline.mPostPingMap); gPipeline.combineGlow(&gPipeline.mPostPingMap, &screen); - gPipeline.renderDoF(&screen, &gPipeline.mPostPingMap); - gPipeline.applyFXAA(&gPipeline.mPostPingMap, &screen); // *HACK: Restore mExposureMap (it will be consumed by generateExposure next frame) gPipeline.mExposureMap.swapFBORefs(gPipeline.mLastExposure); // Final render - gDeferredPostNoDoFProgram.bind(); // From LLPipeline::renderFinalize: "Whatever is last in the above post processing chain should _always_ be rendered directly here. If not, expect problems." diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index c9fbeba2f3..5bb33a65f2 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -139,7 +139,8 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes ENavMeshRequestStatus status; if ( pContent.has(NAVMESH_DATA_FIELD) ) { - const LLSD::Binary &value = pContent.get(NAVMESH_DATA_FIELD).asBinary(); + LLSD nav_data = pContent.get(NAVMESH_DATA_FIELD); + const LLSD::Binary& value = nav_data.asBinary(); auto binSize = value.size(); std::string newStr(reinterpret_cast<const char *>(&value[0]), binSize); std::istringstream streamdecomp( newStr ); diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index cbd63184e9..0fb18c28ae 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -54,7 +54,6 @@ LLVersionInfo::LLVersionInfo(): // macro expands to the string name of the channel, but without quotes. We // need to turn it into a quoted string. LL_TO_STRING() does that. mWorkingChannelName(LL_TO_STRING(LL_VIEWER_CHANNEL)), - build_configuration(LLBUILD_CONFIG), // set in indra/cmake/BuildVersion.cmake // instantiate an LLEventMailDrop with canonical name to listen for news // from SLVersionChecker mPump{new LLEventMailDrop("relnotes")}, @@ -170,7 +169,15 @@ LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity() const std::string LLVersionInfo::getBuildConfig() const { - return build_configuration; +#if LL_DEBUG + return "Debug"; +#elif LL_RELEASE_WITH_DEBUG_INFO + return "RelWithDebInfo"; +#elif LL_RELEASE_FOR_DOWNLOAD + return "Release"; +#else + return "Unknown"; +#endif } std::string LLVersionInfo::getReleaseNotes() const diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h index 237b37a084..8c384565e4 100644 --- a/indra/newview/llversioninfo.h +++ b/indra/newview/llversioninfo.h @@ -108,7 +108,6 @@ private: // Storage for the "version and channel" string. // This will get reset too. mutable std::string mVersionChannel; - std::string build_configuration; std::string mReleaseNotes; // Store unique_ptrs to the next couple things so we don't have to explain // to every consumer of this header file all the details of each. diff --git a/indra/newview/llversioninfovars.h.in b/indra/newview/llversioninfovars.h.in index fe834406e6..2984f05bb3 100644 --- a/indra/newview/llversioninfovars.h.in +++ b/indra/newview/llversioninfovars.h.in @@ -28,4 +28,3 @@ #define LL_VIEWER_VERSION_MINOR @VIEWER_VERSION_MINOR@ #define LL_VIEWER_VERSION_PATCH @VIEWER_VERSION_PATCH@ #define LL_VIEWER_VERSION_BUILD @VIEWER_VERSION_REVISION@ -#define LLBUILD_CONFIG "@CMAKE_BUILD_TYPE@" |
