Commit Graph

84 Commits

Author SHA1 Message Date
Jason Rhinelander
f1aa27e616 fix speeling mistack 2020-02-25 22:27:34 -04:00
Jeff Becker
bf0416cab8
remove Time_t, add operator overload for printing llarp_time_t and add to_json function for serializing llarp_time_t to json 2020-02-25 12:05:13 -05:00
Jeff Becker
d2d109e92c
llarp_time_t is now using std::chrono 2020-02-24 15:25:03 -05:00
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
ea97a8f2ac
Make format 2020-02-21 10:16:45 -07:00
Thomas Winget
fae86281e9 make path short name look nicer 2020-02-20 17:20:17 -05:00
Thomas Winget
74d421ac2d PathBuildNumber -> NextPathBuildNumber because increment side-effect 2020-02-20 16:57:48 -05:00
Thomas Winget
893ef2b874 const-y-ness and move-y-ness 2020-02-20 16:46:07 -05:00
Thomas Winget
fc56a018e5 path builder prints hops, rest print short name 2020-02-20 16:37:39 -05:00
Jeff Becker
499e346da6
notify delivery of path builds 2020-02-06 12:12:39 -05:00
Jeff Becker
56dce90de9
add trace log level for tracking logic thread jobs 2019-11-22 16:23:19 -05:00
Thomas Winget
ef1a5652ef
remove our paths from outbound queues 2019-11-07 13:23:06 -05:00
Jeff Becker
7ee026fa50
make path builds work again 2019-11-05 11:58:53 -05:00
jeff
14c9ef15ed try calling stuff in logic thread from event loop 2019-09-16 06:21:12 -04:00
Jeff Becker
bcf9135da6
testnet 2019-09-05 16:20:55 -04:00
Jeff Becker
1adae338ce
Merge remote-tracking branch 'origin/master' 2019-09-04 07:58:02 -04:00
Michael
edd0ec398f
Move thread stuff to subdirectory 2019-09-03 20:52:28 +01:00
Michael
4d8fe2a8a8
Move meta programming to subdirectory 2019-09-03 20:52:28 +01:00
Jeff Becker
c01112e4b7
tracy lock contention testing and other fun things 2019-09-03 11:56:56 -04:00
Michael
094b697b01
Replace StatusObject with underlying JSON type 2019-08-19 10:33:26 +01:00
Michael
a270fe5f33
fixup! Fix gcc trunk warnings 2019-08-02 10:34:56 +01:00
Michael
f9e9227e19
Fix gcc trunk warnings 2019-08-02 10:29:08 +01:00
Jeff Becker
aa0a795689
call path build fail stuff in logic thread 2019-07-31 08:51:24 -04:00
Jeff Becker
60fbeca9d4
const correctness 2019-07-29 12:43:24 -04:00
Jeff Becker
db2206664a
fix crashes in testnet 2019-07-29 11:10:20 -04:00
Jeff Becker
f48754c45d
make hop count and length configurable 2019-07-18 12:28:17 -04:00
Jeff Becker
b9bcc2b775
make threadpool consice 2019-07-09 09:47:24 -04:00
Jeff Becker
d6ec528a72
start work on seperating ips out of endpoint 2019-07-01 10:56:56 -04:00
Jeff Becker
64e9622270
start seperating tun and endpoint 2019-07-01 09:44:25 -04:00
Michael
b6b400baef
Tidy up pathbuilder code 2019-06-20 17:35:40 +01:00
Michael
b89689fec3
Refactor path build code 2019-06-18 22:51:41 +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
068fec82fb
set lifetime of paths 2019-05-28 10:06:01 -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
dd8a93a400
Apply rule of zero to code base 2019-05-19 23:11:07 +01:00
Jeff Becker
a4e90ee769
hax to make it work. 2019-05-16 14:55:12 -04:00
Jeff Becker
d3a98db267
don't resize frames 2019-05-15 10:55:01 -04:00
Jeff Becker
486042511c
log hops 2019-05-08 10:30:55 -04:00
Jeff Becker
540c2e1666
fix previous commit 2019-05-08 10:18:04 -04:00
Jeff Becker
df322e1149
don't include duplicate hops in paths 2019-05-08 10:01:31 -04:00
Jeff Becker
b68f539de6
limit outbound connections 2019-05-08 08:17:48 -04:00
Jeff Becker
7b03b63d13
more sighup code 2019-05-07 14:15:22 -04:00
Jeff Becker
a53da68700
start work on sighup 2019-05-07 13:46:38 -04:00
Jeff Becker
61d42811be
prevent crash 2019-05-07 09:04:43 -04:00
Jeff Becker
34533db620
add urgent build that builds over an existing path for an endpoint 2019-05-07 08:31:34 -04:00
Jeff Becker
b9adf90fb9
remove random timer fuzz 2019-05-06 12:13:41 -04:00
Jeff Becker
6c17bf35b3
decrease minimum path build interval 2019-05-06 12:00:10 -04:00
Jeff
01906c5d94 Merge remote-tracking branch 'origin/master' 2019-04-28 13:33:27 -04:00