Commit Graph

5465 Commits (aeeb4e06b7b5e4a31f7e98e7d92d5d5080759d9e)
 

Author SHA1 Message Date
Jason Rhinelander b4440094b0 De-abseil, part 2: mutex, locks, (most) time
- util::Mutex is now a std::shared_timed_mutex, which is capable of
  exclusive and shared locks.

- util::Lock is still present as a std::lock_guard<util::Mutex>.

- the locking annotations are preserved, but updated to the latest
  supported by clang rather than using abseil's older/deprecated ones.

- ACQUIRE_LOCK macro is gone since we don't pass mutexes by pointer into
  locks anymore (WTF abseil).

- ReleasableLock is gone.  Instead there are now some llarp::util helper
  methods to obtain unique and/or shared locks:
    - `auto lock = util::unique_lock(mutex);` gets an RAII-but-also
      unlockable object (std::unique_lock<T>, with T inferred from
      `mutex`).
    - `auto lock = util::shared_lock(mutex);` gets an RAII shared (i.e.
      "reader") lock of the mutex.
    - `auto lock = util::unique_locks(mutex1, mutex2, mutex3);` can be
      used to atomically lock multiple mutexes at once (returning a
      tuple of the locks).
  This are templated on the mutex which makes them a bit more flexible
  than using a concrete type: they can be used for any type of lockable
  mutex, not only util::Mutex.  (Some of the code here uses them for
  getting locks around a std::mutex).  Until C++17, using the RAII types
  is painfully verbose:

  ```C++
  // pre-C++17 - needing to figure out the mutex type here is annoying:
  std::unique_lock<util::Mutex> lock(mutex);
  // pre-C++17 and even more verbose (but at least the type isn't needed):
  std::unique_lock<decltype(mutex)> lock(mutex);
  // our compromise:
  auto lock = util::unique_lock(mutex);
  // C++17:
  std::unique_lock lock(mutex);
  ```

  All of these functions will also warn (under gcc or clang) if you
  discard the return value.  You can also do fancy things like
  `auto l = util::unique_lock(mutex, std::adopt_lock)` (which lets a
  lock take over an already-locked mutex).

- metrics code is gone, which also removes a big pile of code that was
  only used by metrics:
  - llarp::util::Scheduler
  - llarp:🧵:TimerQueue
  - llarp::util::Stopwatch
5 years ago
Jeff 9c0f230dbf
Merge pull request #1120 from notlesh/fix-the-build-2020-02-21
Fix the build
5 years ago
Stephen Shelton ea97a8f2ac
Make format 5 years ago
Jeff 2868b3327b
Merge pull request #1119 from jagerman/update-osx-image
Update osx image to latest on travis
5 years ago
Stephen Shelton 16be86a5c3
Merge pull request #1116 from tewinget/short-path-names
path builder prints hops, rest print short name
5 years ago
Jason Rhinelander 4c38206944 Remove unneeded mingw homebrew dep 5 years ago
Jason Rhinelander d517f7d8b2 Do a homebrew update 5 years ago
Jason Rhinelander fa90726fe1 Update osx image to latest on travis 5 years ago
Thomas Winget fae86281e9 make path short name look nicer 5 years ago
Thomas Winget 145efaf0bb should probably build before committing... 5 years ago
Thomas Winget 74d421ac2d PathBuildNumber -> NextPathBuildNumber because increment side-effect 5 years ago
Thomas Winget ad3465ee66 std move better 5 years ago
Thomas Winget 893ef2b874 const-y-ness and move-y-ness 5 years ago
Thomas Winget fc56a018e5 path builder prints hops, rest print short name 5 years ago
Jeff 7c5a721457
Merge pull request #1114 from notlesh/redundant-introset-lookup-improvements-2020-02-20
Redundant introset lookup improvements
5 years ago
Stephen Shelton 63c3106db2
Make format 5 years ago
Jeff Becker 748be8eec8
handle multiple responses per hidden service lookup 5 years ago
Stephen Shelton 0429bafbb3
Merge pull request #1111 from notlesh/redundant-introset-propagation-2020-02-19
Redundant introset propagation
5 years ago
Stephen Shelton 66cb30fa58
Refactor: remove recursionDepth from DHT lookups 5 years ago
Jeff 6ac5f19b3a
Merge pull request #1110 from jagerman/no-abseil-optional
De-abseil, part 1: remove absl::optional
5 years ago
Jeff a9663d10ae
Merge pull request #1112 from jagerman/remove-llvm-homebrew
Remove llvm from travis-ci homebrew packages
5 years ago
Jason Rhinelander 6aedebbfbf Remove llvm from travis-ci homebrew packages
It doesn't seem like we need this for the mac build.
5 years ago
Stephen Shelton 45a36fcfee
Rework FindIntro logic per redundant strategy 5 years ago
Jason Rhinelander 05a2e961e6 Add missing header 5 years ago
Stephen Shelton 4c499fb076
Make format 5 years ago
Stephen Shelton 6966168f5a
Minor improvements to DHT inroset propagation 5 years ago
Stephen Shelton dff9aeb250
Propagate Introset publishing redundantly 5 years ago
Jeff Becker dc7828941f
add log statement 5 years ago
Jason Rhinelander ac1486d0be Replace absl::optional with optional-lite
Step 1 of removing abseil from lokinet.

For the most part this is a drop-in replacement, but there are also a
few changes here to the JSONRPC layer that were needed to work around
current gcc 10 dev snapshot:

- JSONRPC returns a json now instead of an optional<json>.  It doesn't
  make any sense to have a json rpc call that just closes the connection
  with returning anything.  Invoked functions can return a null (default
  constructed) result now if they don't have anything to return (such a
  null value won't be added as "result").
5 years ago
Jason Rhinelander 860ada8e30
Merge pull request #1108 from majestrate/require-router-version-2020-02-19
Require router version in RCs of public routers
5 years ago
Jeff Becker 9a6148c4c3
require router version in public routers 5 years ago
Jeff 6f182c4b26
Merge pull request #1077 from majestrate/mock-lokid-rpc-2020-02-02
mock lokid for loopback testnet
5 years ago
Jeff 20bc168d1c
Merge pull request #1093 from majestrate/toggle-publishing-introsets-2020-02-11
make publishing introsets optional
5 years ago
Jeff bb7dabaace
Merge pull request #1106 from majestrate/use-endpoint-path-for-lookup-2020-02-18
Use endpoint path for outbound context introset update
5 years ago
Jeff Becker 1874f439b7
add comment 5 years ago
Jeff Becker e907d2ae19
handover fixes 5 years ago
Jeff Becker f7f5d893a5
use endpoint path for lookup because outboundcontext does not implement pathset::HandleGotIntroMessage 5 years ago
Jason Rhinelander ecdc389e1a Fix typo in option to disable submodule checks 5 years ago
Jeff 3f29030d1d
Merge pull request #1105 from majestrate/spread-out-path-builds-2020-02-17
spread out path builds
5 years ago
Jeff Becker c9866b6a0b
simplify 5 years ago
Jeff Becker 9aeee37347
short circuit 5 years ago
Jeff Becker 6a495dd090
ammend outbound context logic 5 years ago
Jeff Becker 02228ded08
spread out path builds 5 years ago
Jeff 3a631aa39c
Merge pull request #1104 from jagerman/reduce-introset-publishes
Reduce introset publishing interal to 2.5min instead of 1.25min
5 years ago
Jason Rhinelander 9e096d1996 Reduce introset publishing interal to 2.5min instead of 1.25min
We want to have some redundancy, but having 8 active at once seems
extreme; reduce to 4.
5 years ago
Jeff f8c2ef340f
Merge pull request #1103 from majestrate/catch2-submodule-2020-02-17
make catch2 a submodule
5 years ago
Jeff Becker 827ca0bda7
make catch2 a submodule 5 years ago
Jeff e098c9628f
Merge pull request #1102 from jagerman/update-ghc-fs
Update ghc-filesystem to include rick's upstreamed patches
5 years ago
Jason Rhinelander 186e4245bd Update ghc-filesystem to include rick's upstreamed patches 5 years ago
Jason Rhinelander 2bd783f743
Merge pull request #1091 from majestrate/redundant-dht-lookups-2020-02-10
Redundant dht lookups
5 years ago