Skip to content
Snippets Groups Projects
  1. Aug 07, 2020
  2. Jul 21, 2020
  3. Mar 25, 2020
    • Nat Goodspeed's avatar
      DRTVWR-476: Add unit tests for LLMainThreadTask. · 38da7d5d
      Nat Goodspeed authored
      Now that we have the Sync class to help construct unit tests that move forward
      in a deterministic stepwise order, we can build suitable unit tests for
      LLMainThreadTask.
      38da7d5d
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
      DRTVWR-476: Remove llwrap(), LLListenerWrapper[Base] and support. · 18e2b9ca
      Nat Goodspeed authored
      The only usage of any of this was in test code.
      18e2b9ca
    • Nat Goodspeed's avatar
      DRTVWR-476: Add basic tests for LLCond. · 9a3afe96
      Nat Goodspeed authored
      9a3afe96
    • Nat Goodspeed's avatar
      SL-793: Use Boost.Fiber instead of the "dcoroutine" library. · 66981fab
      Nat Goodspeed authored
      Longtime fans will remember that the "dcoroutine" library is a Google Summer
      of Code project by Giovanni P. Deretta. He originally called it
      "Boost.Coroutine," and we originally added it to our 3p-boost autobuild
      package as such. But when the official Boost.Coroutine library came along
      (with a very different API), and we still needed the API of the GSoC project,
      we renamed the unofficial one "dcoroutine" to allow coexistence.
      
      The "dcoroutine" library had an internal low-level API more or less analogous
      to Boost.Context. We later introduced an implementation of that internal API
      based on Boost.Context, a step towards eliminating the GSoC code in favor of
      official, supported Boost code.
      
      However, recent versions of Boost.Context no longer support the API on which
      we built the shim for "dcoroutine." We started down the path of reimplementing
      that shim using the current Boost.Context API -- then realized that it's time
      to bite the bullet and replace the "dcoroutine" API with the Boost.Fiber API,
      which we've been itching to do for literally years now.
      
      Naturally, most of the heavy lifting is in llcoros.{h,cpp} and
      lleventcoro.{h,cpp} -- which is good: the LLCoros layer abstracts away most of
      the differences between "dcoroutine" and Boost.Fiber.
      
      The one feature Boost.Fiber does not provide is the ability to forcibly
      terminate some other fiber. Accordingly, disable LLCoros::kill() and
      LLCoprocedureManager::shutdown(). The only known shutdown() call was in
      LLCoprocedurePool's destructor.
      
      We also took the opportunity to remove postAndSuspend2() and its associated
      machinery: FutureListener2, LLErrorEvent, errorException(), errorLog(),
      LLCoroEventPumps. All that dual-LLEventPump stuff was introduced at a time
      when the Responder pattern was king, and we assumed we'd want to listen on one
      LLEventPump with the success handler and on another with the error handler. We
      have never actually used that in practice. Remove associated tests, of course.
      
      There is one other semantic difference that necessitates patching a number of
      tests: with "dcoroutine," fulfilling a future IMMEDIATELY resumes the waiting
      coroutine. With Boost.Fiber, fulfilling a future merely marks the fiber as
      ready to resume next time the scheduler gets around to it. To observe the test
      side effects, we've inserted a number of llcoro::suspend() calls -- also in
      the main loop.
      
      For a long time we retained a single unit test exercising the raw "dcoroutine"
      API. Remove that.
      
      Eliminate llcoro_get_id.{h,cpp}, which provided llcoro::get_id(), which was a
      hack to emulate fiber-local variables. Since Boost.Fiber has an actual API for
      that, remove the hack.
      
      In fact, use (new alias) LLCoros::local_ptr for LLSingleton's dependency
      tracking in place of llcoro::get_id().
      
      In CMake land, replace BOOST_COROUTINE_LIBRARY with BOOST_FIBER_LIBRARY. We
      don't actually use the Boost.Coroutine for anything (though there exist
      plausible use cases).
      66981fab
    • Nat Goodspeed's avatar
      DRTVWR-494: Add LLMainThreadTask to perform work on the main thread. · 960593fd
      Nat Goodspeed authored
      If already running on the main thread, LLMaintThreadTask simply runs the work
      inline. Otherwise it queues it for the main thread using LLEventTimer, using
      std::future to retrieve the result.
      960593fd
    • Nat Goodspeed's avatar
      DRTVWR-494: Extract LockStatic as a standalone template class. · 1f7335fd
      Nat Goodspeed authored
      The pattern of requiring a lock to permit *any* access to a static instance of
      something seems generally useful. Break out lockstatic.h; recast
      LLInstanceTracker to use it.
      
      Moving LockStatic to an external template class instead of a nested class in
      LLInstanceTrackerBase leaves LLInstanceTrackerBase pretty empty. Get rid of it.
      
      And *that* means we can move the definition of the StaticData used by each
      LLInstanceTracker specialization into the class itself, rather than having to
      define it beforehand in namespace LLInstanceTrackerStuff.
      1f7335fd
  4. Jan 15, 2019
  5. Sep 07, 2018
  6. Sep 05, 2018
  7. Aug 24, 2018
    • Nat Goodspeed's avatar
      DRTVWR-447: Introduce explicit CMake BUGSPLAT_DB variable. · c2178bb6
      Nat Goodspeed authored
      Define the CMake cache variable, with empty string as its default.
      
      Make build.sh pass the BUGSPLAT_DB environment variable as a CMake
      command-line variable assignment.
      
      Change CMake 'if (DEFINED ENV{BUGSPLAT_DB})' to plain 'if (BUGSPLAT_DB)'.
      
      Make CMake pass new --bugsplat switch to every one of SIX different
      invocations of viewer_manifest.py.
      
      Give llmanifest.main() function an argument to allow supplementing the base
      set of command-line switches with additional application-specific switches.
      
      In viewer_manifest.py, define new --bugsplat command-line switch and pass to
      llmanifest.main(). Instead of consulting os.environ['BUGSPLAT_DB'], consult
      self.args['bugsplat'].
      c2178bb6
  8. Jun 14, 2018
  9. May 17, 2018
    • Nat Goodspeed's avatar
      SL-821: Move Windows BugSplat engagement from llcommon to newview. · c5f618d0
      Nat Goodspeed authored
      Use WSTRINGIZE(), LL_TO_WSTRING(), wstringize() to produce required wide
      strings. Use a lambda for callback that sends log file; use LLDir, if set, to
      find the log file.
      
      Introduce BUGSPLAT CMake variable to allow suppressing BugSplat.
      Make BUGSPLAT CMake variable set LL_BUGSPLAT for C++ compilations.
      
      Set viewer version macros on llappviewerwin32.cpp, llappviewerlinux.cpp and
      llappdelegate-objc.mm -- because BugSplat needs the viewer version data, and
      because the macOS BugSplat hook is engaged in an Objective-C++ function we
      override in the app delegate.
      c5f618d0
  10. May 11, 2018
  11. Dec 14, 2017
  12. Oct 24, 2017
  13. Oct 18, 2017
  14. Jul 28, 2017
  15. May 10, 2017
    • Nat Goodspeed's avatar
      Add LLEventThrottle tests; actually *all* lleventfilter.cpp tests. · 9c66072c
      Nat Goodspeed authored
      For some reason there wasn't an entry in indra/llcommon/CMakeLists.txt to run
      the tests in indra/llcommon/tests/lleventfilter_test.cpp. It seems likely that
      at some point it existed, since all previous tests built and ran successfully.
      In any case, (re-)add lleventfilter_test.cpp to the set of llcommon tests.
      Also alphabetize them to make it easier to find a particular test invocation.
      
      Also add new tests for LLEventThrottle.
      
      To support this, refactor the concrete LLEventThrottle class into
      LLEventThrottleBase containing all the tricky logic, with pure virtual
      methods for access to LLTimer and LLEventTimeout, and an LLEventThrottle
      subclass containing the LLTimer and LLEventTimeout instances and corresponding
      implementations of the new pure virtual methods.
      
      That permits us to introduce TestEventThrottle, an alternate subclass with
      dummy implementations of the methods related to LLTimer and LLEventTimeout. In
      particular, we can explicitly advance simulated realtime to simulate
      particular LLTimer and LLEventTimeout behaviors.
      
      Finally, introduce Concat, a test LLEventPump listener class whose function is
      to concatenate received string event data into a composite string so we can
      readily test for particular sequences of events.
      9c66072c
  16. Dec 01, 2016
    • Nat Goodspeed's avatar
      DRTVWR-418: Until we figure out how to say FIXED:NO to linker, don't. · 8a461c00
      Nat Goodspeed authored
      The present CMake logic wants to pass FIXED:NO to the linker for 64-bit
      builds, which on the face of it seems like a Good Thing: it permits code to be
      relocated in memory, preventing collisions if two libraries happen to want to
      load into overlapping address ranges.
      
      However the way it's being specified is wrong and harmful. Passing /FIXED:NO
      to the compiler command line engages /FI (Forced Include!) of a nonexistent
      file XED:NO -- producing lots of baffling fatal compile errors.
      
      Thanks Callum for diagnosing this!
      8a461c00
  17. Nov 15, 2016
    • Nat Goodspeed's avatar
      DRTVWR-418: Fold windows64 into windows platform with new autobuild. · 6c7a9728
      Nat Goodspeed authored
      autobuild 1.1 now supports expanding $variables within a config file --
      support that was explicitly added to address this very problem. So now the
      windows platform in autobuild.xml uses $AUTOBUILD_ADDRSIZE,
      $AUTOBUILD_WIN_VSPLATFORM and $AUTOBUILD_WIN_CMAKE_GEN, which should handle
      most of the deltas between the windows platform and windows64.
      
      This permits removing the windows64 platform definition from autobuild.xml.
      
      The one remaining delta between the windows64 and windows platform definitions
      was -DLL_64BIT_BUILD=TRUE. But we can handle that instead by checking
      ADDRESS_SIZE. Change all existing references to WORD_SIZE to ADDRESS_SIZE
      instead, and set ADDRESS_SIZE to $AUTOBUILD_ADDRSIZE. Change the one existing
      LL_64BIT_BUILD reference to test (ADDRESS_SIZE EQUAL 64) instead.
      6c7a9728
  18. Oct 12, 2016
  19. Sep 03, 2016
  20. Aug 30, 2016
    • Nat Goodspeed's avatar
      MAINT-5232: Move "llerror.h" out of llcleanup.h, llinitdestroyclass.h · dcdccb3e
      Nat Goodspeed authored
      Introduce corresponding llcleanup.cpp, llinitdestroyclass.cpp modules to
      contain code that performs logging calls.
      
      Track class::method names for LLInitClass<T> and LLDestroyClass<T> subclasses,
      and log them when called. The order in which these calls occur could be
      relevant to bugs, and could surface the need to convert to LLSingleton
      dependencies.
      dcdccb3e
  21. Aug 17, 2016
    • Nat Goodspeed's avatar
      MAINT-5011: Add llexception_test.cpp with tests (and conclusions). · 1ed76c38
      Nat Goodspeed authored
      llexception_test.cpp is an unusual test source in that it need not be verified
      on every build, so its invocation in indra/llcommon/CMakeLists.txt is
      commented out with that remark. Its purpose is to help a developer decide what
      base class(es) to use for LLException, how to throw and how to catch.
      
      Our current conclusions are written up as comments in llexception_test.cpp.
      
      Added CRASH_ON_UNHANDLED_EXCEPTION() and LOG_UNHANDLED_EXCEPTION() macros to
      llexception.h -- macros to log __FILE__, __LINE__ and __PRETTY_FUNCTION__ of
      the catch site. These invoke functions in llexception.cpp so we don't need to
      #include llerror.h for every possible catch site.
      1ed76c38
  22. Jul 19, 2016
    • Nat Goodspeed's avatar
      MAINT-5011: Introduce LLException base class for viewer exceptions. · 9c49a6c9
      Nat Goodspeed authored
      This also introduces LLContinueError for exceptions which should interrupt
      some part of viewer processing (e.g. the current coroutine) but should attempt
      to let the viewer session proceed.
      
      Derive all existing viewer exception classes from LLException rather than from
      std::runtime_error or std::logic_error.
      
      Use BOOST_THROW_EXCEPTION() rather than plain 'throw' to enrich the thrown
      exception with source file, line number and containing function.
      9c49a6c9
  23. Apr 21, 2016
  24. Jan 26, 2016
  25. Dec 18, 2015
  26. Nov 20, 2015
  27. Nov 10, 2015
  28. Oct 31, 2015
  29. Oct 17, 2015
  30. Aug 25, 2015
  31. Aug 19, 2015
  32. Jun 17, 2015
  33. May 27, 2015
    • Nat Goodspeed's avatar
      MAINT-5232: Extract LLInitClass, LLDestroyClass from llui/llui.h · 9f962c03
      Nat Goodspeed authored
      to a new llcommon/llinitdestroyclass.h.
      This mechanism is so general -- but has so many related moving parts -- that
      (a) it deserves to be in a header file all its own, instead of conflated with
      llui.h, and (b) it should be in llcommon where anyone can use it. It has no
      dependencies whatsoever on llui or anything viewer-specific.
      In this very changeset we changed one #include "llui.h" whose comment admits
      that it was only dragged in for LLDestroyClass.
      9f962c03
Loading