Commit Graph
16 Commits
Author SHA1 Message Date
andrey cc8e8644f1 fix(picloud-dispatcher): do not close/delete clients under map_mutex — deadlock
cleanClients() (timer thread) called close()/stopAndWait() and
disconnectClient() (read thread) did the same while holding
map_mutex, while client read threads wait for the same lock in
registerServer/registerClient/disconnectClient — a guaranteed
deadlock (the -w watchdog aborts exactly this). disconnectClient
could also wait for its own read thread (self-wait in
waitThreadedReadFinished) and the destructor never stopped the timer
or drained the clients, leaving dangling lambda captures of this.

Restructure around a single drainer (the timer thread):
- cleanClients: under map_mutex only mark (move rmrf_* out, mark
  ping-timeout/orphaned clients); after the unlock close
  (stopAndWait) and delete the connections, then delete the servers
- disconnectClient: only mark under the lock, then request a
  non-blocking stop() on the affected connections; the drainer waits
  and deletes (no self-wait, nothing blocks while holding the lock)
- newConnection: start the read thread after releasing the lock
- ~DispatcherServer: stop watchdog/timer first, then close and delete
  all clients before the servers (raw-pointer order) and eth

The watchdog is now a PIThread member so the destructor can stop it;
setMaxConnections takes map_mutex like its readers.
2026-08-23 17:18:03 +03:00
peri4 92a87a0c64 picloud add "-w" option for watchdog 2024-10-15 15:04:39 +03:00
peri4 1c7fc39b6c version 4.0.0_alpha
in almost all methods removed timeouts in milliseconds, replaced to PISystemTime
PITimer rewrite, remove internal impl, now only thread implementation, API similar to PIThread
PITimer API no longer pass void*
PIPeer, PIConnection improved stability on reinit and exit
PISystemTime new methods
pisd now exit without hanging
2024-07-30 14:18:02 +03:00
peri4 d46b5e008a try to fix cloud again 2024-06-01 22:27:39 +03:00
peri4 2db9440a38 fix cloud ... :-/ 2024-03-25 21:24:29 +03:00
peri4 2ac215c19e separate PIEthernet::Address to PINetworkAddress, typedef PIEthernet::Address to PINetworkAddress and mark as deprecated
PIValueTree new attributes for File and Dir
2022-12-19 14:29:18 +03:00
peri4 c2b8a8d6da code format 2022-12-14 14:13:52 +03:00
andrey f8818c8537 picloud patch 2021-08-12 19:50:17 +03:00
andrey ca09b9d14b piclouddispatcher patch 2021-08-06 10:49:14 +03:00
andrey dbd2267a8c PICloud change protocol > server_uuid 2021-04-12 11:35:34 +03:00
andrey f75ce1e8e0 PICloud Dispatcher screen mode 2021-04-09 16:44:05 +03:00
andrey be0db84147 PICloud connect/disconnect 2021-04-06 15:24:58 +03:00
andrey f0d4801d3c picloud next iteration 2021-04-05 17:42:02 +03:00
andrey 234d4e73be picloud 2020-08-27 19:40:11 +03:00
andrey cfebf8cf23 cloud test 2020-08-26 17:28:56 +03:00
andrey 3f7f67e198 picloud start develop 2020-06-15 11:09:34 +03:00