This repository was archived by the owner on Jan 20, 2025. It is now read-only.
Commit 8ee20ad
committed
Protect against AsyncClient being destroyed in the middle of processing
- Take the _asyncsock_mutex in AsyncClient destructor. This should
handle scenarios where a previously-valid client is destroyed by
another task while being examined by the asyncTcpSock task.
- Since the _asyncsock_mutex is released before being taken again by the
AsyncSocketBase destructor, examined objects may be still "half-destroyed"
(AsyncClient destructor terminated and _write_mutex invalid, but still
waiting for lock in AsyncSocketBase destructor). However, _socket may
now be guaranteed to remain valid if it was valid when the
_asyncsock_mutex was taken.1 parent 8607ac1 commit 8ee20ad
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
126 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| |||
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
150 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
151 | 157 | | |
152 | 158 | | |
153 | 159 | | |
| |||
294 | 300 | | |
295 | 301 | | |
296 | 302 | | |
| 303 | + | |
297 | 304 | | |
298 | 305 | | |
299 | 306 | | |
300 | 307 | | |
| 308 | + | |
301 | 309 | | |
302 | 310 | | |
303 | 311 | | |
| |||
0 commit comments