Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f65320d

Browse files
committed
tracing thread safety
1 parent bb66600 commit f65320d

File tree

5 files changed

+216
-82
lines changed

5 files changed

+216
-82
lines changed

Include/internal/pycore_ceval_state.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct _ceval_runtime_state {
6363
} perf;
6464
/* Pending calls to be made only on the main thread. */
6565
struct _pending_calls pending_mainthread;
66+
PyMutex sys_trace_profile_mutex;
6667
};
6768

6869
#ifdef PY_HAVE_PERF_TRAMPOLINE

Include/internal/pycore_pyatomic_ft_wrappers.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,25 @@ extern "C" {
2323
#define FT_ATOMIC_LOAD_SSIZE(value) _Py_atomic_load_ssize(&value)
2424
#define FT_ATOMIC_LOAD_SSIZE_RELAXED(value) \
2525
_Py_atomic_load_ssize_relaxed(&value)
26+
#define FT_ATOMIC_LOAD_PTR_ACQUIRE(value) \
27+
_Py_atomic_load_ptr_acquire(&value)
2628
#define FT_ATOMIC_STORE_PTR_RELAXED(value, new_value) \
2729
_Py_atomic_store_ptr_relaxed(&value, new_value)
2830
#define FT_ATOMIC_STORE_PTR_RELEASE(value, new_value) \
2931
_Py_atomic_store_ptr_release(&value, new_value)
3032
#define FT_ATOMIC_STORE_SSIZE_RELAXED(value, new_value) \
3133
_Py_atomic_store_ssize_relaxed(&value, new_value)
34+
#define FT_ATOMIC_STORE_UINT8_RELAXED(value, new_value) \
35+
_Py_atomic_store_uint8_relaxed(&value, new_value)
3236
#else
3337
#define FT_ATOMIC_LOAD_SSIZE(value) value
3438
#define FT_ATOMIC_LOAD_SSIZE_RELAXED(value) value
39+
#define FT_ATOMIC_LOAD_PTR_ACQUIRE(value) value
3540
#define FT_ATOMIC_STORE_PTR_RELAXED(value, new_value) value = new_value
3641
#define FT_ATOMIC_STORE_PTR_RELEASE(value, new_value) value = new_value
3742
#define FT_ATOMIC_STORE_SSIZE_RELAXED(value, new_value) value = new_value
43+
#define FT_ATOMIC_STORE_UINT8_RELAXED(value, new_value) value = new_value
44+
3845
#endif
3946

4047
#ifdef __cplusplus

0 commit comments

Comments
 (0)