giampaolo / psutil

Cross-platform lib for process and system monitoring in Python
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.38k forks source link

Fix GIL warnings and a few thread-safety issues in free-threaded CPython #2428

Closed colesbury closed 3 months ago

colesbury commented 3 months ago

Summary

Description

This adds PyUnstable_Module_SetGIL calls to allow psutil to run with the GIL disabled in the CPython free-threading builds. This also fixes a few thread-safety that could cause problems with the GIL disabled: