mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-131253: free-threaded build support for pystats (gh-137189)
Allow the --enable-pystats build option to be used with free-threading. The stats are now stored on a per-interpreter basis, rather than process global. For free-threaded builds, the stats structure is allocated per-thread and then periodically merged into the per-interpreter stats structure (on thread exit or when the reporting function is called). Most of the pystats related code has be moved into the file Python/pystats.c.
This commit is contained in:
parent
cf1a2c1ee4
commit
c98c5b3449
24 changed files with 1269 additions and 485 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "pycore_parking_lot.h"
|
||||
#include "pycore_semaphore.h"
|
||||
#include "pycore_time.h" // _PyTime_Add()
|
||||
#include "pycore_stats.h" // FT_STAT_MUTEX_SLEEP_INC()
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
|
|
@ -62,6 +63,8 @@ _PyMutex_LockTimed(PyMutex *m, PyTime_t timeout, _PyLockFlags flags)
|
|||
return PY_LOCK_FAILURE;
|
||||
}
|
||||
|
||||
FT_STAT_MUTEX_SLEEP_INC();
|
||||
|
||||
PyTime_t now;
|
||||
// silently ignore error: cannot report error to the caller
|
||||
(void)PyTime_MonotonicRaw(&now);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue