lokinet/llarp
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
..
android Produce hierarchy of 'libraries' inside libllarp 2019-01-15 23:15:43 +00:00
config De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
consensus initial wack at 0.7.0 dht fixes 2020-01-27 11:54:51 -05:00
constants initial wack at 0.7.0 dht fixes 2020-01-27 11:54:51 -05:00
crypto Abstract signing hash data location 2020-02-02 16:38:48 -04:00
dht Merge pull request #1114 from notlesh/redundant-introset-lookup-improvements-2020-02-20 2020-02-20 15:25:09 -05:00
dns prune unused files. 2019-12-15 07:02:17 -05:00
ev monotonic time and run testnet at 20% realtime 2020-01-23 12:14:25 -05:00
exit m_LastUse shouldn't be 0 ever now 2020-01-08 11:05:29 -05:00
handlers make default endpoint non reachable by default 2020-02-12 09:54:59 -05:00
hook prepare for 0.5.0 2019-08-29 07:45:58 -04:00
iwp De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
link De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
linux Produce hierarchy of 'libraries' inside libllarp 2019-01-15 23:15:43 +00:00
messages De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
net Endian defines fix for macOS 2020-02-07 03:29:50 -04:00
path De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
router De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
routing initial wack at 0.7.0 dht fixes 2020-01-27 11:54:51 -05:00
rpc Replace absl::optional with optional-lite 2020-02-19 18:21:25 -04:00
service De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
util De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
win32 happy new year 2020-01-05 20:40:34 -06:00
app.xml stray tag ;-; 2018-12-24 22:39:34 -06:00
bootstrap.cpp add bootstrap list functionality and utility 2019-12-06 12:32:46 -05:00
bootstrap.hpp add bootstrap list functionality and utility 2019-12-06 12:32:46 -05:00
CMakeLists.txt De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
context.cpp De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
nodedb.cpp De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
nodedb.hpp De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
pow.cpp prepare for 0.5.0 2019-08-29 07:45:58 -04:00
pow.hpp Port code to use CryptoManager over passing Crypto pointers 2019-05-28 20:45:08 +01:00
profiling.cpp De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
profiling.hpp De-abseil, part 2: mutex, locks, (most) time 2020-02-21 23:22:47 -04:00
router_contact.cpp Merge pull request #1110 from jagerman/no-abseil-optional 2020-02-20 12:38:16 -05:00
router_contact.hpp Replace absl::optional with optional-lite 2020-02-19 18:21:25 -04:00
router_id.cpp prepare for 0.5.0 2019-08-29 07:45:58 -04:00
router_id.hpp prepare for 0.5.0 2019-08-29 07:45:58 -04:00
router_version.cpp Make format 2020-01-31 14:52:59 -07:00
router_version.hpp Make format 2020-01-31 14:52:59 -07:00
testnet.c prepare for 0.5.0 2019-08-29 07:45:58 -04:00