giampaolo / psutil

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

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

Closed colesbury closed 5 months ago

colesbury commented 5 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: