Commit 9bb149a
fix: improve thread safety in tool registry
- Use thread-safe registry.unregister() in remove_tool()
- Use thread-safe registry.list_tools() in list_tools()
- Add double-checked locking to get_registry() singleton
- Prevents race conditions in multi-agent deployments
Related to #1167 and closed PR #1182
Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>1 parent 6a90cc0 commit 9bb149a
1 file changed
Lines changed: 9 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
| 253 | + | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
257 | | - | |
| 258 | + | |
258 | 259 | | |
259 | 260 | | |
260 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
261 | 265 | | |
262 | 266 | | |
263 | 267 | | |
| |||
309 | 313 | | |
310 | 314 | | |
311 | 315 | | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
| 316 | + | |
320 | 317 | | |
321 | 318 | | |
322 | 319 | | |
| |||
325 | 322 | | |
326 | 323 | | |
327 | 324 | | |
328 | | - | |
329 | | - | |
| 325 | + | |
330 | 326 | | |
331 | 327 | | |
332 | 328 | | |
| |||
0 commit comments