Commit dbee01f
committed
Cleanups for some minor potential future issues
I asked GitHub Copilot to review my changes. It didn't see any
problems, but I looked at its thought process and cleaned up things
that it had to think carefully about.
* Fix typo in an older CHANGELOG entry.
* Add comments about why each documented public attribute of MSSBase,
and a few undocumented but not _-prefixed attributes of MSS
implementations, are safe to not be protected under the lock.
* Document that the user isn't supposed to change with_cursor. Also
document that MSS might ignore it.
* Clarify that the comment "The attributes below are protected by
self._lock" is meant to contrast with the attributes above that
comment.
* In MSSBase.monitors, read the return value self._monitors under the
lock. Current code doesn't ever change self._monitors once it's
created, so it's safe to return outside the lock, but verifying that
requires inspection of the rest of the codebase. This makes it clear
and future-proof.
* Add a test that we can use the same MSS object on multiple threads.1 parent d67d53d commit dbee01f
File tree
5 files changed
+54
-22
lines changed- src
- mss
- tests
5 files changed
+54
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
84 | 92 | | |
85 | 93 | | |
86 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
87 | 99 | | |
88 | 100 | | |
89 | 101 | | |
| |||
209 | 221 | | |
210 | 222 | | |
211 | 223 | | |
212 | | - | |
213 | | - | |
| 224 | + | |
214 | 225 | | |
215 | 226 | | |
216 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
302 | | - | |
303 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
304 | 310 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
311 | 320 | | |
312 | | - | |
| 321 | + | |
| 322 | + | |
313 | 323 | | |
314 | | - | |
315 | | - | |
316 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
317 | 332 | | |
318 | | - | |
319 | | - | |
320 | | - | |
| 333 | + | |
321 | 334 | | |
322 | | - | |
323 | | - | |
| 335 | + | |
| 336 | + | |
324 | 337 | | |
325 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
0 commit comments