Commit Graph

28 Commits

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
2020-02-21 23:22:47 -04:00
Stephen Shelton
66a058a2af Make format 2019-12-06 10:13:09 -07:00
Stephen Shelton
93b8832026
Merge branch 'dev' into private-keys-backup-support 2019-12-03 11:20:45 -07:00
Stephen Shelton
521ef9b5bb Handle link transport key in KeyManager 2019-12-03 10:58:53 -07:00
Jeff Becker
1a06da9c3d reduce calls in link pump 2019-11-29 19:11:14 -04:00
Stephen Shelton
ef2670dfb4 Drop new inbound IWP sessions when the first packet can't be handled 2019-11-19 09:24:29 -07:00
Jeff Becker
c9f26c4911
call Router::PumpLL after every batch of packets from a link session 2019-11-04 13:49:08 -05:00
jeff
3c1d5518d8 fix windows port and make it compile 2019-10-02 09:06:14 -04:00
jeff
32ed821763 Merge remote-tracking branch 'upstream/dev' into multithreaded-cryptography 2019-10-01 10:51:28 -04:00
Michael
86a07e2a80
Enable more sanitisers 2019-09-23 11:47:58 +01:00
Jeff Becker
327c545530
finish multithread cryptography first pass 2019-09-16 12:12:05 -04:00
jeff
14c9ef15ed try calling stuff in logic thread from event loop 2019-09-16 06:21:12 -04:00
jeff
ac2a2aed1d gut libutp and finish making things compile and pass tests 2019-09-12 14:19:25 -04:00
Jeff Becker
3c0245f8b3
Merge remote-tracking branch 'github/master' into iwp-multi-ack 2019-09-05 13:40:04 -04:00
Jeff Becker
4bf6882c8a
more async cryptography 2019-09-05 13:39:09 -04:00
Jeff Becker
88cde21b9b
multithreaded iwp cryptography 2019-09-05 10:57:01 -04:00
Jeff Becker
2ab265be41
disable link layer locking because there was no contention 2019-09-03 11:58:36 -04:00
Jeff Becker
c01112e4b7
tracy lock contention testing and other fun things 2019-09-03 11:56:56 -04:00
Jeff Becker
acf5f78949
update iwp , add NACK 2019-08-23 07:32:52 -04:00
Jeff Becker
426ee41c46
initial iwp 2019-08-22 16:53:27 -04:00
Michael
16cdfbd5f0
clang-tidy modernize pass 2019-08-12 16:52:58 +01:00
Jeff
674f272a46
Merge pull request #630 from majestrate/master
recent stability stuff
2019-05-29 08:20:25 -04:00
Michael
491fee206b
Port code to use CryptoManager over passing Crypto pointers 2019-05-28 20:45:08 +01:00
Jeff Becker
27c101cc32
close timed out sessions 2019-05-25 10:54:30 -04:00
Jeff Becker
64c7ed42fc
make format 2019-05-22 12:20:50 -04:00
Jeff Becker
9c96aecf3f
move llarp::Logic to std::shared_ptr
add sequence numbers to HSD messages

begin work on network isolation code

add more docs
2019-05-22 12:20:03 -04:00
Michael
25f10d5b11
Fix more address sanitiser issues 2019-04-02 10:03:53 +01:00
Michael
561b997c93
Move IWP code to its own directory 2019-03-29 16:00:12 +00:00